# CONFIG_INPUT_UINPUT is not set
# CONFIG_INPUT_GPIO is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+CONFIG_INPUT_WM831X_ON=y
CONFIG_G_SENSOR_DEVICE=y
# CONFIG_GS_MMA7660 is not set
CONFIG_GS_MMA8452=y
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_WM8994 is not set
+CONFIG_GPIO_WM831X=y
#
# PCI GPIO expanders:
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
# CONFIG_PDA_POWER is not set
+CONFIG_WM831X_BACKUP=y
+CONFIG_WM831X_POWER=y
# CONFIG_BATTERY_DS2760 is not set
# CONFIG_BATTERY_DS2782 is not set
# CONFIG_BATTERY_BQ27x00 is not set
# CONFIG_PMIC_DA903X is not set
CONFIG_MFD_WM8994=y
# CONFIG_MFD_WM8400 is not set
-# CONFIG_MFD_WM831X_I2C is not set
+CONFIG_MFD_WM831X=y
+CONFIG_MFD_WM831X_I2C=y
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_PCF50633 is not set
# CONFIG_AB3100_CORE is not set
# CONFIG_REGULATOR_BQ24022 is not set
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_WM8994 is not set
+CONFIG_REGULATOR_WM831X=y
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_BACKLIGHT_WM831X=y
CONFIG_BACKLIGHT_RK29_BL=y
#
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_V3020 is not set
+CONFIG_RTC_DRV_WM831X=y
#
# on-CPU RTC drivers
#endif
#if defined(CONFIG_GPIO_WM831X)
-struct rk2818_gpio_expander_info wm831x_gpio_settinginfo[] = {
+struct rk29_gpio_expander_info wm831x_gpio_settinginfo[] = {
{
.gpio_num =WM831X_P01,// tp3
.pin_type = GPIO_OUT,
static int wm831x_init_pin_type(struct wm831x *wm831x)
{
-#if 0
+#if 1
struct wm831x_pdata *pdata = wm831x->dev->platform_data;
- struct rk2818_gpio_expander_info *wm831x_gpio_settinginfo;
+ struct rk29_gpio_expander_info *wm831x_gpio_settinginfo;
uint16_t offset = 0;
uint16_t wm831x_settingpin_num = 0;
uint16_t ret = 0;
#ifdef CONFIG_I2C2_RK29
static struct i2c_board_info __initdata board_i2c2_devices[] = {
+#if defined (CONFIG_MFD_WM831X_I2C)
+{
+ .type = "wm8310",
+ .addr = 0x34,
+ .flags = 0,
+ .irq = RK29_PIN4_PD0,
+ .platform_data = &wm831x_platdata,
+},
+#endif
#if defined (CONFIG_HANNSTAR_P1003)
{
.type = "p1003_touch",
.platform_data = &xpt2046_info,
},
#endif
+
+#if defined(CONFIG_MFD_WM831X_SPI)
+ {
+ .modalias = "wm8310",
+ .chip_select = 1,
+ .max_speed_hz = 12*1000*1000,
+ .bus_num = 1,
+ .irq = RK29_PIN4_PD0,
+ .platform_data = &wm831x_platdata,
+ },
+#endif
+
};
#include <linux/timer.h>
#include <linux/notifier.h>
+/* platform device data structures */
+struct platform_device;
+struct i2c_client;
+
/*spi*/
struct spi_cs_gpio {
const char *name;
int gpio_DRDY;
};
+struct rk29_gpio_expander_info {
+ unsigned int gpio_num;// ³õʼ»¯µÄpin ½Åºê¶¨Òå È磺rk29_PIN_PI0
+ unsigned int pin_type;//³õʼ»¯µÄpin ΪÊäÈëpin»¹ÊÇÊä³öpin È磺GPIO_IN
+ unsigned int pin_value;//Èç¹ûΪ output pin ÉèÖõçƽ£¬È磺GPIO_HIGH
+};
+
+struct tca6424_platform_data {
+ /* the first extern gpio number in all of gpio groups */
+ unsigned int gpio_base;
+ unsigned int gpio_pin_num;
+ /* the first gpio irq number in all of irq source */
+
+ unsigned int gpio_irq_start;
+ unsigned int irq_pin_num; //ÖжϵĸöÊý
+ unsigned int tca6424_irq_pin; //À©Õ¹IOµÄÖжϹÒÔÚÄĸögpio
+ unsigned int expand_port_group;
+ unsigned int expand_port_pinnum;
+ unsigned int rk_irq_mode;
+ unsigned int rk_irq_gpio_pull_up_down;
+
+ /* initial polarity inversion setting */
+ uint16_t invert;
+ struct rk29_gpio_expander_info *settinginfo;
+ int settinginfolen;
+ void *context; /* param to setup/teardown */
+
+ int (*setup)(struct i2c_client *client,unsigned gpio, unsigned ngpio,void *context);
+ int (*teardown)(struct i2c_client *client,unsigned gpio, unsigned ngpio,void *context);
+ char **names;
+ void (*reseti2cpin)(void);
+};
+
void __init rk29_setup_early_printk(void);
void __init rk29_map_common_io(void);
void __init rk29_clock_init(void);
//struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
struct regulator* ldo;
- if (reboot_cmd_get())
- return 0;
+ //if (reboot_cmd_get())
+ // return 0;
printk("%s\n", __FUNCTION__);
ldo = regulator_get(NULL, "ldo1");
unsigned offset, int value);
void (*set)(struct gpio_chip *chip,
unsigned offset, int value);
-
+
+ int (*set_debounce)(struct gpio_chip *chip,
+ unsigned offset, unsigned debounce);
+
int (*pull_updown)(struct gpio_chip *chip,
unsigned offset, unsigned value);