资源简介
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_
相关资源
- netbeans 导入源代码
- 异步fifo设计verilog源代码
- 豆瓣网安卓源代码
- minix3源代码
- 实验9X stm32F407zgt6_PWM控制SG90输出实验
- AES算法实现源代码
- 音乐播放器含源代码
- Cocos Creator重力小游戏《给我滚》开源
- DirectX地月系+高度图地形源代码
- LabVIEW 2012 Simon 小游戏 编程 源代码
- 串口精灵源代码 串口精灵源代码
- SIFT\\PCA-SIFT\\SURF论文源代码
- [单片微机原理与接口技术——基于
- 线程池实现蚁群算法的简单并行
- 跨域请求解决方案源代码JSONPCORS
- jfreechartDEMO官网demo与源代码
- 比特币bitcoin源代码
- 网络流量实时监控源代码
- 小甲鱼汇编语言课件+源代码
- 微信公众平台开发最佳实践 源代码
- Canny算子源代码
- 蓝牙4.0 协议栈 开源代码
- 基于nrf51822的TSM12触控例程
- 小人吐笑脸案例源代码
- C编译器源代码187076
- 《Spark高级数据分析》源代码
- DSP语音识别教程+源代码
- PCRat远控开源代码
- OpenCV图像处理教程 - 贾志刚 课程配套
- Qt 串口助手增强版带示波器曲线源代
评论
共有 条评论