diff options
author | Philipp Zabel <philipp.zabel@gmail.com> | 2008-04-12 13:25:41 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 11:29:08 +0100 |
commit | 5dc3339aa5ba29593ea57814049ddca8c12831c8 (patch) | |
tree | 0481d4344d0cf4052effce8605706414ce63ce8a /include | |
parent | 481ea5a16aaabe2570d56b5a4d29fa80adc8008b (diff) | |
download | op-kernel-dev-5dc3339aa5ba29593ea57814049ddca8c12831c8.zip op-kernel-dev-5dc3339aa5ba29593ea57814049ddca8c12831c8.tar.gz |
[ARM] 4964/1: htc-pasic3: MFD driver for PASIC3 LED control + DS1WM chip
This driver will provide registers, clocks and GPIOs of
the HTC PASIC3 (AIC3) and PASIC2 (AIC2) chips to the
ds1wm and leds-pasic3 drivers.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/htc-pasic3.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/linux/mfd/htc-pasic3.h b/include/linux/mfd/htc-pasic3.h new file mode 100644 index 0000000..b4294f1 --- /dev/null +++ b/include/linux/mfd/htc-pasic3.h @@ -0,0 +1,55 @@ +/* + * HTC PASIC3 driver - LEDs and DS1WM + * + * Copyright (c) 2007 Philipp Zabel <philipp.zabel@gmail.com> + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + */ + +#ifndef __PASIC3_H +#define __PASIC3_H + +#include <linux/platform_device.h> +#include <linux/leds.h> + +extern void pasic3_write_register(struct device *dev, u32 reg, u8 val); +extern u8 pasic3_read_register(struct device *dev, u32 reg); + +/* + * mask for registers 0x20,0x21,0x22 + */ +#define PASIC3_MASK_LED0 0x04 +#define PASIC3_MASK_LED1 0x08 +#define PASIC3_MASK_LED2 0x40 + +/* + * bits in register 0x06 + */ +#define PASIC3_BIT2_LED0 0x08 +#define PASIC3_BIT2_LED1 0x10 +#define PASIC3_BIT2_LED2 0x20 + +struct pasic3_led { + struct led_classdev led; + unsigned int hw_num; + unsigned int bit2; + unsigned int mask; + struct pasic3_leds_machinfo *pdata; +}; + +struct pasic3_leds_machinfo { + unsigned int num_leds; + unsigned int power_gpio; + struct pasic3_led *leds; +}; + +struct pasic3_platform_data { + struct pasic3_leds_machinfo *led_pdata; + unsigned int bus_shift; + unsigned int clock_rate; +}; + +#endif |