summaryrefslogtreecommitdiff
path: root/include/media
diff options
context:
space:
mode:
authorErik Lilliebjerg <elilliebjerg@nvidia.com>2011-12-01 05:25:20 -0700
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-08 18:04:39 +0530
commitf674050c9063a9d11ec33681bfcca89f6c62b067 (patch)
treea62b7c1269440ec4c20d87037ddfcb5db7ef956c /include/media
parentc5bdbc470a503e1d045c6fdf23185b6149f841b7 (diff)
media: video: tegra: TPS61050 torch driver
- Added multi-instance support with sync capability - Added GLOS power scheme - Standardized the IOCTL API Bug 860351 Bug 850614 Bug 852480 Bug 872156 Bug 824459 Change-Id: I858edfb4437ca1f7121790a5580b8825a8d925ae Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/66164 Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/tps61050.h107
1 files changed, 23 insertions, 84 deletions
diff --git a/include/media/tps61050.h b/include/media/tps61050.h
index ac7a328a4b2d..1c289eb3616e 100644
--- a/include/media/tps61050.h
+++ b/include/media/tps61050.h
@@ -1,97 +1,36 @@
-/*
- * tps61050.h - tps61050 flash/torch kernel driver
+/* Copyright (C) 2011 NVIDIA Corporation.
*
- * Copyright (C) 2011 NVIDIA Corp.
+ * 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 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.
+ * 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 __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
+#include <media/nvc_torch.h>
-#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];
-};
+#define TPS61050_MAX_TORCH_LEVEL 7
+#define TPS61050_MAX_FLASH_LEVEL 8
-#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);
+ unsigned cfg; /* use the NVC_CFG_ defines */
+ unsigned num; /* see implementation notes in driver */
+ unsigned sync; /* see implementation notes in driver */
+ const char *dev_name; /* see implementation notes in driver */
+ struct nvc_torch_pin_state (*pinstate); /* see notes in driver */
+ unsigned max_amp_torch; /* see implementation notes in driver */
+ unsigned max_amp_flash; /* see implementation notes in driver */
};
-#endif /* __KERNEL__ */
#endif /* __TPS61050_H__ */