From c93252fe4964991bc6d2b200f740fe59995f3342 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 2 Nov 2009 19:54:35 +0100 Subject: backlight/mfd: Add pcf50633 backlight driver This patch adds a backlight driver controling the pcf50633 led converter. Signed-off-by: Lars-Peter Clausen --- include/linux/mfd/pcf50633/backlight.h | 44 ++++++++++++++++++++++++++++++++++ include/linux/mfd/pcf50633/core.h | 4 ++++ 2 files changed, 48 insertions(+) create mode 100644 include/linux/mfd/pcf50633/backlight.h (limited to 'include/linux/mfd') diff --git a/include/linux/mfd/pcf50633/backlight.h b/include/linux/mfd/pcf50633/backlight.h new file mode 100644 index 00000000000..9d3646af056 --- /dev/null +++ b/include/linux/mfd/pcf50633/backlight.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2009, Lars-Peter Clausen + * PCF50633 backlight device driver + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * 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., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifndef __LINUX_MFD_PCF50633_BACKLIGHT +#define __LINUX_MFD_PCF50633_BACKLIGHT + +/* +* @default_brightness: Brightness to be used after the driver has been + probed. Valid range 0-63. +* @default_brightness_limit: Brightness limit to be used after the driver has +* been probed. This is usfull when it is not known +* how much power is available for the backlight +* during probe. Valid range 0-63 +* @ramp_time: When changing the backlights brightness the change +* is not instant, instead it fades smooth from one +* state to another. This value specifies how long the +* fade should take. The lower the value the higher +* the fade time. Valid range 0-255 +*/ +struct pcf50633_bl_platform_data { + unsigned int default_brightness; + unsigned int default_brightness_limit; + uint8_t ramp_time; +}; + + +struct pcf50633; + +int pcf50633_bl_set_brightness_limit(struct pcf50633 *pcf, unsigned int limit); + +#endif + diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index 3398bd9aab1..ad411a78870 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h @@ -18,6 +18,7 @@ #include #include #include +#include struct pcf50633; @@ -43,6 +44,8 @@ struct pcf50633_platform_data { void (*force_shutdown)(struct pcf50633 *); u8 resumers[5]; + + struct pcf50633_bl_platform_data *backlight_data; }; struct pcf50633_irq { @@ -152,6 +155,7 @@ struct pcf50633 { struct platform_device *mbc_pdev; struct platform_device *adc_pdev; struct platform_device *input_pdev; + struct platform_device *bl_pdev; struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS]; }; -- cgit v1.2.3 From 1608707cca9c9eac88f34a48346435dc0bd75259 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 22 Jan 2010 12:47:01 +0100 Subject: pcf50633-gpio: Add gpiolib support. --- include/linux/mfd/pcf50633/core.h | 4 +++ include/linux/mfd/pcf50633/gpio.h | 59 ++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 28 deletions(-) (limited to 'include/linux/mfd') diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index ad411a78870..9953fa14ec9 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h @@ -19,6 +19,7 @@ #include #include #include +#include struct pcf50633; @@ -46,6 +47,8 @@ struct pcf50633_platform_data { u8 resumers[5]; struct pcf50633_bl_platform_data *backlight_data; + + int gpio_base; }; struct pcf50633_irq { @@ -151,6 +154,7 @@ struct pcf50633 { int onkey1s_held; + struct platform_device *gpio_pdev; struct platform_device *rtc_pdev; struct platform_device *mbc_pdev; struct platform_device *adc_pdev; diff --git a/include/linux/mfd/pcf50633/gpio.h b/include/linux/mfd/pcf50633/gpio.h index a42b845efc5..af2c341d5f6 100644 --- a/include/linux/mfd/pcf50633/gpio.h +++ b/include/linux/mfd/pcf50633/gpio.h @@ -15,37 +15,40 @@ #include -#define PCF50633_GPIO1 1 -#define PCF50633_GPIO2 2 -#define PCF50633_GPIO3 3 -#define PCF50633_GPO 4 - -#define PCF50633_REG_GPIO1CFG 0x14 -#define PCF50633_REG_GPIO2CFG 0x15 -#define PCF50633_REG_GPIO3CFG 0x16 -#define PCF50633_REG_GPOCFG 0x17 - -#define PCF50633_GPOCFG_GPOSEL_MASK 0x07 - -enum pcf50633_reg_gpocfg { - PCF50633_GPOCFG_GPOSEL_0 = 0x00, - PCF50633_GPOCFG_GPOSEL_LED_NFET = 0x01, - PCF50633_GPOCFG_GPOSEL_SYSxOK = 0x02, - PCF50633_GPOCFG_GPOSEL_CLK32K = 0x03, - PCF50633_GPOCFG_GPOSEL_ADAPUSB = 0x04, - PCF50633_GPOCFG_GPOSEL_USBxOK = 0x05, - PCF50633_GPOCFG_GPOSEL_ACTPH4 = 0x06, - PCF50633_GPOCFG_GPOSEL_1 = 0x07, - PCF50633_GPOCFG_GPOSEL_INVERSE = 0x08, +#define PCF50633_GPIO1 0 +#define PCF50633_GPIO2 1 +#define PCF50633_GPIO3 2 +#define PCF50633_GPO 3 + +#define PCF50633_REG_GPIOCFG(x) (0x14 + (x)) + +enum pcf50633_gpio_config { + PCF50633_GPIO_CONFIG_OUTPUT = 0x0, + PCF50633_GPIO_CONFIG_SYSxOK = 0x2, + PCF50633_GPIO_CONFIG_CHARGING = 0x3, + PCF50633_GPIO_CONFIG_MOBILE_MODE = 0x4, + PCF50633_GPIO_CONFIG_USBxOK = 0x5, + PCF50633_GPIO_CONFIG_ACTPH = 0x6, + PCF50633_GPIO_CONFIG_INPUT = 0x7, + + PCF50633_GPIO_CONFIG_INVERT = 0x8, + + PCF50633_GPO_CONFIG_OUTPUT = 0x0, + PCF50633_GPO_CONFIG_LED_NFET = 0x1, + PCF50633_GPO_CONFIG_SYSxOK = 0x2, + PCF50633_GPO_CONFIG_CLK32K = 0x3, + PCF50633_GPO_CONFIG_MOBILE_MODE = 0x4, + PCF50633_GPO_CONFIG_USBxOK = 0x5, + PCF50633_GPO_CONFIG_ACTPH = 0x6, + PCF50633_GPO_CONFIG_INPUT = 0x7, + + PCF50633_GPO_CONFIG_INVERT = 0x8, }; -int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val); -u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio); +int pcf50633_gpio_set_config(struct pcf50633 *pcf, unsigned gpio, + enum pcf50633_gpio_config config); -int pcf50633_gpio_invert_set(struct pcf50633 *, int gpio, int invert); -int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio); - -int pcf50633_gpio_power_supply_set(struct pcf50633 *, +int pcf50633_gpio_power_supply_set(struct pcf50633 *pcf, int gpio, int regulator, int on); #endif /* __LINUX_MFD_PCF50633_GPIO_H */ -- cgit v1.2.3 From 09cb945ad762e9a7f258287942918dd4a3badae4 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 4 Oct 2009 13:47:44 +0200 Subject: Add glamo driver. --- include/linux/mfd/glamo.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 include/linux/mfd/glamo.h (limited to 'include/linux/mfd') diff --git a/include/linux/mfd/glamo.h b/include/linux/mfd/glamo.h new file mode 100644 index 00000000000..529d4f07f03 --- /dev/null +++ b/include/linux/mfd/glamo.h @@ -0,0 +1,52 @@ +#ifndef __GLAMO_MFD_H +#define __GLAMO_MFD_H + +struct glamo_core; +struct glamo_spigpio_platform_data; +struct glamo_fb_platform_data; + +struct glamo_mmc_platform_data { + int (*glamo_mmc_use_slow)(void); + + struct glamo_core *core; +}; + +struct glamo_gpio_platform_data { + int base; + void (*registered)(struct device *dev); +}; + +struct glamo_platform_data { + struct glamo_fb_platform_data *fb_data; + struct glamo_mmc_platform_data *mmc_data; + struct glamo_gpio_platform_data *gpio_data; + + unsigned int osci_clock_rate; + + void (*glamo_external_reset)(int); +}; + +enum glamo_engine { + GLAMO_ENGINE_CAPTURE = 0, + GLAMO_ENGINE_ISP = 1, + GLAMO_ENGINE_JPEG = 2, + GLAMO_ENGINE_MPEG_ENC = 3, + GLAMO_ENGINE_MPEG_DEC = 4, + GLAMO_ENGINE_LCD = 5, + GLAMO_ENGINE_CMDQ = 6, + GLAMO_ENGINE_2D = 7, + GLAMO_ENGINE_3D = 8, + GLAMO_ENGINE_MMC = 9, + GLAMO_ENGINE_MICROP0 = 10, + GLAMO_ENGINE_RISC = 11, + GLAMO_ENGINE_MICROP1_MPEG_ENC = 12, + GLAMO_ENGINE_MICROP1_MPEG_DEC = 13, +#if 0 + GLAMO_ENGINE_H264_DEC = 14, + GLAMO_ENGINE_RISC1 = 15, + GLAMO_ENGINE_SPI = 16, +#endif + __NUM_GLAMO_ENGINES +}; + +#endif -- cgit v1.2.3