diff options
author | Ming Wong <miwong@nvidia.com> | 2014-01-10 12:23:50 -0800 |
---|---|---|
committer | Sachin Nikam <snikam@nvidia.com> | 2014-01-16 00:56:59 -0800 |
commit | 908b2f172be5aea21c29ac3cebfba75eec81e184 (patch) | |
tree | 216b729362059ba2f5fba3d76bdd3ac1ea3eb9b4 /include/media | |
parent | b8a898bcc14b73f678cff8d5e77993c1d1f5e947 (diff) |
media: convert imx179 driver to non-nvc format
bug 1415077
Change-Id: I98ea518ea8de07b2cd78066522c039dadee379bd
Signed-off-by: Ming Wong <miwong@nvidia.com>
Reviewed-on: http://git-master/r/354372
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Prayas Mohanty <pmohanty@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/imx179.h | 113 |
1 files changed, 72 insertions, 41 deletions
diff --git a/include/media/imx179.h b/include/media/imx179.h index 52acf5e14e98..cc6bfd32de02 100644 --- a/include/media/imx179.h +++ b/include/media/imx179.h @@ -1,59 +1,90 @@ -/* -* imx179.h -* -* Copyright (c) 2013, NVIDIA CORPORATION, All rights reserved. -* -* This file is licensed under the terms of the GNU General Public License -* version 2. This program is licensed "as is" without any warranty of any -* kind, whether express or implied. -*/ +/** + * Copyright (c) 2012-2014, NVIDIA Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope 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, see <http://www.gnu.org/licenses/>. + */ #ifndef __IMX179_H__ #define __IMX179_H__ +#include <linux/ioctl.h> /* For IOCTL macros */ +#include <linux/edp.h> #include <media/nvc.h> #include <media/nvc_image.h> -/* See notes in the nvc.h file on the GPIO usage */ -enum imx179_gpio { - IMX179_GPIO_RESET = 0, - IMX179_GPIO_PWDN, - IMX179_GPIO_GP1, +#define IMX179_IOCTL_SET_MODE _IOW('o', 1, struct imx179_mode) +#define IMX179_IOCTL_GET_STATUS _IOR('o', 2, __u8) +#define IMX179_IOCTL_SET_FRAME_LENGTH _IOW('o', 3, __u32) +#define IMX179_IOCTL_SET_COARSE_TIME _IOW('o', 4, __u32) +#define IMX179_IOCTL_SET_GAIN _IOW('o', 5, __u16) +#define IMX179_IOCTL_GET_SENSORDATA _IOR('o', 6, struct imx179_sensordata) +#define IMX179_IOCTL_SET_GROUP_HOLD _IOW('o', 7, struct imx179_ae) +#define IMX179_IOCTL_SET_POWER _IOW('o', 20, __u32) +#define IMX179_IOCTL_GET_FLASH_CAP _IOR('o', 30, __u32) +#define IMX179_IOCTL_SET_FLASH_MODE _IOW('o', 31, \ + struct imx179_flash_control) + +struct imx179_mode { + int xres; + int yres; + __u32 frame_length; + __u32 coarse_time; + __u16 gain; +}; + +struct imx179_ae { + __u32 frame_length; + __u8 frame_length_enable; + __u32 coarse_time; + __u8 coarse_time_enable; + __s32 gain; + __u8 gain_enable; }; -/* The enumeration must be in the order the regulators are to be enabled */ -/* See Power Requirements note in the driver */ -enum imx179_vreg { - IMX179_VREG_DVDD = 0, - IMX179_VREG_AVDD, - IMX179_VREG_IOVDD, +struct imx179_sensordata { + __u32 fuse_id_size; + __u8 fuse_id[16]; }; -struct imx179_flash_config { - u8 xvs_trigger_enabled; - u8 sdo_trigger_enabled; - u8 adjustable_flash_timing; - u16 pulse_width_uS; +struct imx179_flash_control { + u8 enable; + u8 edge_trig_en; + u8 start_edge; + u8 repeat; + u16 delay_frm; +}; + + +#ifdef __KERNEL__ +struct imx179_power_rail { + struct regulator *dvdd; + struct regulator *avdd; + struct regulator *iovdd; + struct regulator *ext_reg1; + struct regulator *ext_reg2; }; struct imx179_platform_data { - unsigned cfg; - unsigned num; - unsigned sync; - const char *dev_name; - unsigned gpio_count; /* see nvc.h GPIO notes */ - struct nvc_gpio_pdata *gpio; /* see nvc.h GPIO notes */ - struct imx179_flash_config flash_cap; - struct nvc_imager_cap *cap; - unsigned lens_focal_length; /* / _INT2FLOAT_DIVISOR */ - unsigned lens_max_aperture; /* / _INT2FLOAT_DIVISOR */ - unsigned lens_fnumber; /* / _INT2FLOAT_DIVISOR */ - unsigned lens_view_angle_h; /* / _INT2FLOAT_DIVISOR */ - unsigned lens_view_angle_v; /* / _INT2FLOAT_DIVISOR */ + struct imx179_flash_control flash_cap; const char *mclk_name; /* NULL for default default_mclk */ - int (*probe_clock)(unsigned long); - int (*power_on)(struct nvc_regulator *); - int (*power_off)(struct nvc_regulator *); + struct edp_client edpc_config; + unsigned int cam1_gpio; + unsigned int reset_gpio; + unsigned int af_gpio; + bool ext_reg; + int (*power_on)(struct imx179_power_rail *pw); + int (*power_off)(struct imx179_power_rail *pw); }; +#endif /* __KERNEL__ */ #endif /* __IMX179_H__ */ |