diff options
author | Charlie Huang <chahuang@nvidia.com> | 2012-11-27 16:15:16 -0800 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-12-10 16:01:18 -0800 |
commit | 8900e2ba7233162ceb7a5912128503c5d15be3aa (patch) | |
tree | 0d8703c76232016243f46363517fa9844963cde2 /include/media | |
parent | 7a1dca95c091a1e3f342f04136ea3c853c1e8895 (diff) |
drivers: tegra: max77665 flash/imx091: edp support
enable edp support on max77665 flash device and imx091 camera sensor.
the E-state tables added are not finetuned, need calibrate later.
bug 1159989
bug 1159987
Change-Id: I9b4339247099ec1808a677f9a4bfc7b10325d625
Signed-off-by: Charlie Huang <chahuang@nvidia.com>
Reviewed-on: http://git-master/r/166733
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Wei Chen <wechen@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/imx091.h | 1 | ||||
-rw-r--r-- | include/media/max77665-flash.h | 12 | ||||
-rw-r--r-- | include/media/nvc_torch.h | 70 |
3 files changed, 83 insertions, 0 deletions
diff --git a/include/media/imx091.h b/include/media/imx091.h index 4c101f35ee28..7f56765cd528 100644 --- a/include/media/imx091.h +++ b/include/media/imx091.h @@ -50,6 +50,7 @@ struct imx091_platform_data { unsigned lens_fnumber; /* / _INT2FLOAT_DIVISOR */ unsigned lens_view_angle_h; /* / _INT2FLOAT_DIVISOR */ unsigned lens_view_angle_v; /* / _INT2FLOAT_DIVISOR */ + struct edp_client edpc_config; int (*probe_clock)(unsigned long); int (*power_on)(struct nvc_regulator *); int (*power_off)(struct nvc_regulator *); diff --git a/include/media/max77665-flash.h b/include/media/max77665-flash.h index 98fddadeae6a..fc1edc6917c5 100644 --- a/include/media/max77665-flash.h +++ b/include/media/max77665-flash.h @@ -28,8 +28,18 @@ struct max77665_f_power_rail { struct regulator *i2c; }; +struct max77665_f_led_config { + u16 color_setting; + u16 flash_torch_ratio; /* max flash to max torch ratio, in 1/1000 */ + u16 granularity; /* 1, 10, 100, ... to carry float settings */ + u16 flash_levels; /* calibrated flash levels < 32 */ + /* this table contains the calibrated flash level - luminance pair */ + struct nvc_torch_lumi_level_v1 *lumi_levels; +}; + struct max77665_f_config { u32 led_mask; /* led(s) enabled, 1/2/3 - left/right/both */ + bool synchronized_led; /* if both leds enabled, consider as one. */ bool flash_on_torch; /* true=high level on the torch_en pin will turn on flash */ u16 flash_mode; /* 1=one_shot_mode, flash is triggerred on the @@ -80,6 +90,7 @@ struct max77665_f_config { u16 max_flash_lbdly_r_uS; /* Low battery delay timer for raising edge detection. Adjustable from 256uS to 2048uS in 256uS steps. */ + struct max77665_f_led_config led_config[2]; }; struct max77665_f_platform_data { @@ -90,6 +101,7 @@ struct max77665_f_platform_data { const char *dev_name; /* see implementation notes in driver */ struct nvc_torch_pin_state pinstate; /* see notes in driver */ unsigned gpio_strobe; /* GPIO connected to the ACT signal */ + struct edp_client edpc_config; int (*poweron_callback)(struct max77665_f_power_rail *pw); int (*poweroff_callback)(struct max77665_f_power_rail *pw); diff --git a/include/media/nvc_torch.h b/include/media/nvc_torch.h index 7c88bc75af05..3acdc0cb6ce6 100644 --- a/include/media/nvc_torch.h +++ b/include/media/nvc_torch.h @@ -39,5 +39,75 @@ struct nvc_torch_torch_capabilities { __s32 guidenum[]; } __packed; +/* advanced flash/torch capability settings */ +/* use version number to distinguish between different capability structures */ +#define NVC_TORCH_LED_ATTR_FLASH_SYNC 1 +#define NVC_TORCH_LED_ATTR_IND_FTIMER (1 << 1) +#define NVC_TORCH_LED_ATTR_TORCH_SYNC (1 << 16) +#define NVC_TORCH_LED_ATTR_IND_TTIMER (1 << 17) + +struct nvc_torch_capability_query { + __u8 version; + __u8 flash_num; /* number of flashes supported by this device */ + __u8 torch_num; /* number of torches supported by this device */ + __u8 reserved; + __u32 led_attr; +}; + +#define NVC_TORCH_CAPABILITY_LEGACY 0 +#define NVC_TORCH_CAPABILITY_VER_1 1 + +struct nvc_torch_set_level_v1 { + __u16 ledmask; + __u16 timeout; + /* flash/torch levels mapped to ledmask for lsb to msb respectively */ + __u16 levels[2]; +}; + +struct nvc_torch_lumi_level_v1 { + __u16 guidenum; + __u32 luminance; + __u32 reserved; +}; + +struct nvc_torch_timeout_v1 { + __u32 timeout; + __u32 reserved1; +}; + +struct nvc_torch_timer_capabilities_v1 { + __u32 timeout_num; + /* time out durations in uS */ + struct nvc_torch_timeout_v1 timeouts[]; +}; + +struct nvc_torch_flash_capabilities_v1 { + __u8 version; /* fixed number 1 */ + __u8 led_idx; + __u8 reserved1; + __u8 reserved2; + __u32 attribute; + __u16 granularity; /* 1, 10, 100, ... to carry float settings */ + __u16 flash_torch_ratio; + __u32 timeout_num; + __u32 timeout_off; + __u32 numberoflevels; + struct nvc_torch_lumi_level_v1 levels[]; +}; + +struct nvc_torch_torch_capabilities_v1 { + __u8 version; /* fixed number 1 */ + __u8 led_idx; + __u8 reserved1; + __u8 reserved2; + __u32 attribute; + __u16 granularity; /* 1, 10, 100, ... to carry float settings */ + __u16 reserved4; + __u32 timeout_num; + __u32 timeout_off; + __u32 numberoflevels; + struct nvc_torch_lumi_level_v1 levels[]; +}; + #endif /* __NVC_TORCH_H__ */ |