diff options
author | Danielle Sun <dsun@nvidia.com> | 2011-05-26 16:17:44 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:47:22 -0800 |
commit | ee95306a08528e24f4303bf2cc5bd6993940a452 (patch) | |
tree | a00c59991e04e955214e282530ebc5ea1e56bb01 /include/media | |
parent | 6158523a1472cb2a60c41f720c1c766d77c1a7a4 (diff) |
media: video: tegra: TPS61050 flash driver
Kernel driver for TPS61050 flash/torch camera device.
Bug 794431
Original-Change-Id: I760bd086c283076dc7136bd8ccd6b75e6e823ea8
Reviewed-on: http://git-master/r/34208
Tested-by: Erik M Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-by: Michael Stewart <mstewart@nvidia.com>
Reviewed-by: John Sasinowski <jsasinowski@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Rebase-Id: Radb862760f165e40b764b3bb104787427d024c7e
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/tps61050.h | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/include/media/tps61050.h b/include/media/tps61050.h new file mode 100644 index 000000000000..ac7a328a4b2d --- /dev/null +++ b/include/media/tps61050.h @@ -0,0 +1,97 @@ +/* + * tps61050.h - tps61050 flash/torch kernel driver + * + * Copyright (C) 2011 NVIDIA Corp. + * + * 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. + */ + +#ifndef __TPS61050_H__ +#define __TPS61050_H__ + +#include <linux/ioctl.h> /* For IOCTL macros */ + +#define NUM_TORCH_LEVELS 8 +#define NUM_FLASH_LEVELS 9 + +/* Expected higher level power calls are: + * 1 = OFF + * 2 = STANDBY + * 3 = ON + * These will be multiplied by 2 before given to the driver PM code + * that uses the _PWR_ defines. This allows us to insert defines + * (most notably _PWR_COMM) allowing more versatile PM. + * The PM actions: + * _PWR_OFF = board support for regulators, clocks, etc so no + * power to device. + * _PWR_STDBY = board support to put device in reset. Device is + * useless but powered. No communication possible. + * _PWR_COMM = Device is powered but in SW standby. Communication + * is possible and device retains programming. + * _PWR_ON = Full power with active output. + */ + +#define TPS61050_PWR_ERR 0 +#define TPS61050_PWR_OFF 2 +#define TPS61050_PWR_STDBY 4 +#define TPS61050_PWR_COMM 5 +#define TPS61050_PWR_ON 6 + +#define TPS61050_CFG_NOSENSOR (1 << 0) + +#define TPS61050_IOCTL_CAP _IOWR('o', 1, struct tps61050_param) +#define TPS61050_IOCTL_PWR _IOW('o', 2, __u8) +#define TPS61050_IOCTL_PARAM_RD _IOWR('o', 3, struct tps61050_param) +#define TPS61050_IOCTL_PARAM_WR _IOW('o', 4, struct tps61050_param) + +#define TPS61050_FLASH_CAPS 6 +#define TPS61050_FLASH_LEVEL 7 +#define TPS61050_FLASH_PIN_STATE 8 +#define TPS61050_TORCH_CAPS 9 +#define TPS61050_TORCH_LEVEL 10 + +struct tps61050_param { + int param; + __s32 sizeofvalue; + void *p_value; +}; + +struct tps61050_level_info { + __s32 guidenum; + __u32 sustaintime; + __s32 rechargefactor; +}; + +struct tps61050_pin_state { + __u16 mask; + __u16 values; +}; + +struct tps61050_flash_capabilities { + __u32 numberoflevels; + struct tps61050_level_info levels[NUM_FLASH_LEVELS]; +}; + +struct tps61050_torch_capabilities { + __u32 numberoflevels; + __s32 guidenum[NUM_TORCH_LEVELS]; +}; + +#ifdef __KERNEL__ +struct tps61050_platform_data { + int cfg; + int num; + int max_amp_torch; + int max_amp_flash; + void (*pinstate); + int (*init)(void); + void (*exit)(void); + int (*pm)(int); + int (*gpio_envm)(int); + int (*gpio_sync)(int); +}; +#endif /* __KERNEL__ */ + +#endif /* __TPS61050_H__ */ |