资源简介
nvp6134 驱动源代码及规格书。驱动源代码是调试OK的,可以作为参考进行修改。
代码片段和文件信息
/*
* ioctl32.c: Conversion between 32bit and 64bit native ioctls.
*
* Copyright (c) 2017 by Allwinnertech Co. Ltd. http://www.allwinnertech.com
*
* Authors: Zhao Wei
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include
#include
#include
#include
#include
#include
#include “sensor_helper.h“
#ifdef CONFIG_COMPAT
static long native_ioctl(struct v4l2_subdev *sd unsigned int cmd void *arg)
{
return v4l2_subdev_call(sd core ioctl cmd arg);
}
struct sensor_config32 {
int width;
int height;
unsigned int hoffset; /*receive hoffset from sensor output*/
unsigned int voffset; /*receive voffset from sensor output*/
unsigned int hts; /*h size of timing unit: pclk */
unsigned int vts; /*v size of timing unit: line */
unsigned int pclk; /*pixel clock in Hz */
unsigned int bin_factor;/*binning factor */
unsigned int intg_min; /*integration min unit: line Q4 */
unsigned int intg_max; /*integration max unit: line Q4 */
unsigned int gain_min; /*sensor gain min Q4 */
unsigned int gain_max; /*sensor gain max Q4 */
unsigned int mbus_code; /*media bus code */
};
struct sensor_exp_gain32 {
int exp_val;
int gain_val;
};
#define VIDIOC_VIN_SENSOR_CFG_REQ32 \
_IOWR(‘V‘ base_VIDIOC_PRIVATE + 60 struct sensor_config32)
#define VIDIOC_VIN_SENSOR_EXP_GAIN32 \
_IOWR(‘V‘ base_VIDIOC_PRIVATE + 61 struct sensor_exp_gain32)
static int get_sensor_config32(struct sensor_config *kp
struct sensor_config32 __user *up)
{
if (!access_ok(VERIFY_READ up sizeof(struct sensor_config32)) ||
get_user(kp->width &up->width) || get_user(kp->height &up->height) ||
get_user(kp->hoffset &up->hoffset) || get_user(kp->voffset &up->voffset) ||
get_user(kp->hts &up->hts) || get_user(kp->vts &up->vts) ||
get_user(kp->pclk &up->pclk) || get_user(kp->bin_factor &up->bin_factor) ||
get_user(kp->intg_min &up->intg_min) || get_user(kp->intg_max &up->intg_max) ||
get_user(kp->gain_min &up->gain_min) || get_user(kp->gain_max &up->gain_max) ||
get_user(kp->mbus_code &up->mbus_code))
return -EFAULT;
return 0;
}
static int put_sensor_config32(struct sensor_config *kp
struct sensor_config32 __user *up)
{
if (!access_ok(VERIFY_WRITE up sizeof(struct sensor_config32)) ||
put_user(kp->width &up->width) || put_user(kp->height &up->height) ||
put_user(kp->hoffset &up->hoffset) || put_user(kp->voffset &up->voffset) ||
put_user(kp->hts &up->hts) || put_user(kp->vts &up->vts) ||
put_user(kp->pclk &up->pclk) || put_user(kp->bin_factor &up->bin_factor) ||
put_user(kp->intg_
相关资源
- bp神经网络源代码,可直接运行
- 仿知乎界面小程序源代码
- 贪吃蛇源代码.fla
- dotnet 写字板 实验 源代码 不好请要不
- 图像二维小波变换的实现源代码
- 八三编码器设计 VHDL代码 简单,包附
- linux应用层的华容道游戏源代码
- 网上拍卖系统完整源代码
- CSMA/CD等动画演示加源代码
- silicon lab公司的收音IC SI47XX全套开发工
- 合同管理系统的源代码(附数据库)
- 用VC 编写的仿QQ聊天室程序源代码
- STM32F103 串口程序(完整版)
- VPC3_DPV1源代码,Profibus
- PB做的托盘程序(最小化后在左下角显
- 透明加密源码及说明
- 排队机叫号 源代码
- 五子棋C 源代码
- CAD LISP24个源代码
- 二叉树基本操作源代码
- 推箱子及人工智能寻路C 源代码
- opengl轮廓字体源代码
- 冈萨雷斯 数字图像处理 源代码(m文
- 直流伺服电机电路原理图(内附单片
- 哈哈冒险岛登入器源代码
- midi电子琴简单设计(附源代码).ra
- PESQ C源代码
- 画图程序MFC/VC/VC CRectTracker 串行化
- 莱卡 全站仪数据格式转换程序,有源
- HEX到Bin文件源代码
评论
共有 条评论