diff options
author | Sudhir Vyas <svyas@nvidia.com> | 2012-05-17 18:51:37 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-05-24 14:43:36 -0700 |
commit | be1e69e5163ba61068d6a6a61e33778f7cf90b42 (patch) | |
tree | a5d73dc6965f7080cbf7539fe766bf3077f5cb3e /include/media/ad5816.h | |
parent | ee8c9ce26661e83584f4cb5931b0815d38b2843a (diff) |
media: video: tegra: Add ad5816 focuser driver
- Implement new focuser ad5816 driver.
- Complies to latest NVC framework.
Bug 947792
Change-Id: I1661de027062d2a9b4112fd24dc255d810c7afa0
Signed-off-by: Sudhir Vyas <svyas@nvidia.com>
Reviewed-on: http://git-master/r/103131
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'include/media/ad5816.h')
-rw-r--r-- | include/media/ad5816.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/include/media/ad5816.h b/include/media/ad5816.h new file mode 100644 index 000000000000..bfea25ffaddf --- /dev/null +++ b/include/media/ad5816.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2011-2012 NVIDIA Corporation. + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307, USA + */ + +#ifndef __AD5816_H__ +#define __AD5816_H__ + +#include <media/nvc_focus.h> +#include <media/nvc.h> + +typedef enum ad5816_vreg +{ + AD5816_VREG_VDD = 0, + AD5816_VREG_VDD_AF, + AD5816_VREG_VDD_I2C +}; + +typedef enum ad5816_gpio_types +{ + AD5816_GPIO_RESET = 0, + AD5816_GPIO_I2CMUX, + AD5816_GPIO_GP1, + AD5816_GPIO_GP2, + AD5816_GPIO_GP3 +}; + + +struct ad5816_platform_data { + int cfg; + int num; + int sync; + const char *dev_name; + struct nvc_focus_nvc (*nvc); + struct nvc_focus_cap (*cap); + struct ad5816_pdata_info (*info); + int gpio_count; + struct nvc_gpio_pdata *gpio; +}; + +struct ad5816_pdata_info { + float focal_length; + float fnumber; + __u32 settle_time; + __s16 pos_low; + __s16 pos_high; + __s16 limit_low; + __s16 limit_high; + int move_timeoutms; + __u32 focus_hyper_ratio; + __u32 focus_hyper_div; +}; + +// Register Definitions + +#define IC_INFO 0x00 +#define IC_VERSION 0x01 +#define CONTROL 0x02 +#define VCM_CODE_MSB 0x03 +#define VCM_CODE_LSB 0x04 +#define STATUS 0x05 +#define MODE 0x06 +#define VCM_FREQ 0x07 +#define VCM_THRESHOLD 0x08 + + +#endif +/* __AD5816_H__ */
\ No newline at end of file |