add pmu config for rk29_phonesdk_defconfig
authorluowei <lw@rock-chips.com>
Thu, 17 Mar 2011 02:25:18 +0000 (10:25 +0800)
committerluowei <lw@rock-chips.com>
Thu, 17 Mar 2011 02:25:18 +0000 (10:25 +0800)
arch/arm/configs/rk29_phonesdk_defconfig
arch/arm/mach-rk29/board-rk29-phonesdk.c
arch/arm/mach-rk29/include/mach/board.h
drivers/regulator/wm831x-ldo.c
include/asm-generic/gpio.h

index 60abf165f3a487768f23357a1f2ee22fd214ee9d..309a1c84544f103bc988ebca140d2d849e8131bf 100644 (file)
@@ -835,6 +835,7 @@ CONFIG_INPUT_LPSENSOR_ISL29028=y
 # 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
@@ -943,6 +944,7 @@ CONFIG_GPIOLIB=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:
@@ -966,6 +968,8 @@ CONFIG_SPI_FPGA_GPIO_IRQ_NUM=16
 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
@@ -1003,7 +1007,8 @@ CONFIG_MFD_CORE=y
 # 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
@@ -1015,6 +1020,7 @@ CONFIG_REGULATOR=y
 # 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
@@ -1192,6 +1198,7 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y
 # 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
 
 #
@@ -1581,6 +1588,7 @@ CONFIG_RTC_HYM8563=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
index 2ade42c506a50f27954b4c25a51adda48596b6e8..d8a69cdf4699a69b95b2d1704fb8485e8bd8f396 100755 (executable)
@@ -417,7 +417,7 @@ static struct mma8452_platform_data mma8452_info = {
 #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,
@@ -1001,9 +1001,9 @@ static int wm831x_checkrange(int start,int num,int val)
 
 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;
@@ -1403,6 +1403,15 @@ static struct i2c_board_info __initdata board_i2c1_devices[] = {
 
 #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",
@@ -2678,6 +2687,18 @@ static struct spi_board_info board_spi_devices[] = {
                .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
+
 };
 
 
index 01c0eee2df886a9fc43a4e9ad06d1f8182f9d978..eb9de55e73b8005cad808cbf6eb10bb4fb9a8d4d 100755 (executable)
 #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;
@@ -197,6 +201,38 @@ struct akm8975_platform_data {
        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);
index e44d9b4f91534b6c7fd6385da58cdabd95be2766..6ebc657425534a167b2df6b9b369920b5385db06 100755 (executable)
@@ -835,8 +835,8 @@ static __devexit int wm831x_alive_ldo_shutdown(struct platform_device *pdev)        /*Z
        //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");
index f68ea6e02b7e6dd57809c06fd04dbc531911d1d9..49eb6ee841a2ddee10cfcf119b8a39e942fac632 100644 (file)
@@ -89,7 +89,10 @@ struct gpio_chip {
                                                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);