h1940 series
Subsystems (3)
cover h1940 series
This series converts latch API to generic gpiolib API, improves power management and adds sound codec device for h1940.
PATCH 1/5 h1940: use gpiolib for latch access
This patch adds gpiolib support for h1940 latch. With this patch it's possible to use leds-gpio and uda1380 drivers (they require gpiolib support for appropriate pins). And now it's possible to drop leds-h1940 driver.
--- arch/arm/mach-s3c2410/h1940-bluetooth.c | 13 +++- arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 57 ++++++------------ arch/arm/mach-s3c2410/mach-h1940.c | 72 ++++++++++++++++++++-- arch/arm/plat-s3c24xx/Kconfig | 1 + 4 files changed, 95 insertions(+), 48 deletions(-)
arch/arm/mach-s3c2410/h1940-bluetooth.c +10 -3
@@ -30,7 +30,7 @@ static void h1940bt_enable(int on) {if (on) {/* Power on the chip */ -h1940_latch_control (0 ,H1940_LATCH_BLUETOOTH_POWER ); +gpio_set_value (H1940_LATCH_BLUETOOTH_POWER ,1 );/* Reset the chip */ mdelay (10 );
@@ -43,7 +43,7 @@ static void h1940bt_enable(int on)mdelay (10 );gpio_set_value (S3C2410_GPH (1 ),0 );mdelay (10 ); -h1940_latch_control (H1940_LATCH_BLUETOOTH_POWER ,0 ); +gpio_set_value (H1940_LATCH_BLUETOOTH_POWER ,0 ); } }
@@ -64,7 +64,14 @@ static int __devinit h1940bt_probe(struct platform_device *pdev) ret =gpio_request (S3C2410_GPH (1 ),dev_name (&pdev->dev));if (ret) { -dev_err (&pdev->dev,"could not get GPH1\n" );\ +dev_err (&pdev->dev,"could not get GPH1\n" ); +return ret; + } + + ret =gpio_request (H1940_LATCH_BLUETOOTH_POWER ,dev_name (&pdev->dev)); +if (ret) { +gpio_free (S3C2410_GPH (1 )); +dev_err (&pdev->dev,"could not get BT_POWER\n" );return ret; }
arch/arm/mach-s3c2410/include/mach/h1940-latch.h +18 -39
69 lines not on this page · raw message
arch/arm/mach-s3c2410/mach-h1940.c +66 -6
113 lines not on this page · raw message
arch/arm/plat-s3c24xx/Kconfig +1 -0
@@ -69,6 +69,7 @@ config S3C24XX_GPIO_EXTRA int default 128 if S3C24XX_GPIO_EXTRA128 default 64 if S3C24XX_GPIO_EXTRA64 + default 16 if ARCH_H1940 default 0 config S3C24XX_GPIO_EXTRA64
Signature · 1 line
1.7.2.2
PATCH 1/5 h1940: use gpiolib for latch access
Quoted 13 lines · Vasily Khoruzhick
This patch adds gpiolib support for h1940 latch. With this patch it's possible to use leds-gpio and uda1380 drivers (they require gpiolib support for appropriate pins). And now it's possible to drop leds-h1940 driver.
Signed-off-by Vasily Khoruzhick <[email protected]>--- arch/arm/mach-s3c2410/h1940-bluetooth.c | 13 +++- arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 57 ++++++------------ arch/arm/mach-s3c2410/mach-h1940.c | 72 ++++++++++++++++++++-- arch/arm/plat-s3c24xx/Kconfig | 1 + 4 files changed, 95 insertions(+), 48 deletions(-)
snip
Quoted 5 lines
#endif /*
__ASM_ARCH_H1940_LATCH_H*/arch/arm/mach-s3c2410/mach-h1940.c +0
-0
snip
arch/arm/mach-s3c2410/mach-h1940.c void h1940_latch_control(unsigned int clear, unsigned int set) · line 135
Quoted 5 lines
arch/arm/mach-s3c2410/mach-h1940.c +4
-1-EXPORT_SYMBOL_GPL (h1940_latch_control); +static int h1940_gpiolib_latch_input (struct gpio_chip *chip,unsigned offset) +{ +return -EINVAL ; +}
does not setting the field have the same effect, if so, please remove.
Quoted 12 lines
arch/arm/mach-s3c2410/mach-h1940.c +12
-0+ +static inline int h1940_gpiolib_to_latch (int offset) +{ +return 1 << (offset +16 ); +} + +static void h1940_gpiolib_latch_set (struct gpio_chip *chip, +unsigned offset,int value) +{ +int latch_bit =h1940_gpiolib_to_latch (offset); + + h1940_latch_control(value ? 0 : latch_bit,
arch/arm/mach-s3c2410/mach-h1940.c void h1940_latch_control(unsigned int clear, unsigned int set) · line 158
Quoted 10 lines
arch/arm/mach-s3c2410/mach-h1940.c +10
-0+ value ? latch_bit : 0); +} + +static int h1940_gpiolib_latch_output (struct gpio_chip *chip, +unsigned offset,int value) +{ +h1940_gpiolib_latch_set (chip, offset, value); + +return 0 ; +}
you could eliminate the blank line in the above.
Quoted 60 lines
arch/arm/mach-s3c2410/mach-h1940.c +24
-3+ +static int h1940_gpiolib_latch_get (struct gpio_chip *chip, +unsigned offset) +{ +return (latch_state >> (offset +16 )) &1 ; +} + +struct gpio_chip h1940_latch_gpiochip = { + .base =H1940_LATCH_GPIO (0 ), + .owner =THIS_MODULE , + .label ="H1940_LATCH" , + .ngpio =16 , + .direction_input = h1940_gpiolib_latch_input, + .direction_output = h1940_gpiolib_latch_output, + .set = h1940_gpiolib_latch_set, + .get = h1940_gpiolib_latch_get, +};static void h1940_udc_pullup (enum s3c2410_udc_cmd_e cmd) {@@ -125,10 +181,10 @@ static void h1940_udc_pullup(enum s3c2410_udc_cmd_e cmd)switch (cmd) {case S3C2410_UDC_P_ENABLE : -h1940_latch_control (0 ,H1940_LATCH_USB_DP ); +gpio_set_value (H1940_LATCH_USB_DP ,1 );break ;case S3C2410_UDC_P_DISABLE : -h1940_latch_control (H1940_LATCH_USB_DP ,0 ); +gpio_set_value (H1940_LATCH_USB_DP ,0 );break ;case S3C2410_UDC_P_RESET :break ;@@ -303,6 +359,8 @@ static void __init h1940_map_io(void)memcpy (phys_to_virt (H1940_SUSPEND_RESUMEAT ), h1940_pm_return,1024 );#endif s3c_pm_init (); + +WARN_ON (gpiochip_add (&h1940_latch_gpiochip)); }/* H1940 and RX3715 need to reserve this for suspend */ @@ -342,9 +400,11 @@ static void __init h1940_init(void)gpio_request (S3C2410_GPC (0 ),"LCD power" );gpio_request (S3C2410_GPC (5 ),"LCD power" );gpio_request (S3C2410_GPC (6 ),"LCD power" ); -gpio_direction_input (S3C2410_GPC (6 )); +gpio_request (H1940_LATCH_USB_DP ,"USB pullup" ); +gpio_direction_output (H1940_LATCH_USB_DP ,0 ); +platform_add_devices (h1940_devices,ARRAY_SIZE (h1940_devices)); }arch/arm/plat-s3c24xx/Kconfig +0
-0
arch/arm/plat-s3c24xx/Kconfig config S3C24XX_GPIO_EXTRA · line 75
Quoted 7 lines
arch/arm/plat-s3c24xx/Kconfig +1
-0@@ -69,6 +69,7 @@ config S3C24XX_GPIO_EXTRA int default 128 if S3C24XX_GPIO_EXTRA128 default 64 if S3C24XX_GPIO_EXTRA64 + default 16 if ARCH_H1940 default 0 config S3C24XX_GPIO_EXTRA64
hmm, ok, we really need something in Kconfig to set a variable to a min value.
PATCH v2 1/5 h1940: use gpiolib for latch access
This patch adds gpiolib support for h1940 latch. With this patch it's possible to use leds-gpio and uda1380 drivers (they require gpiolib support for appropriate pins). And now it's possible to drop leds-h1940 driver.
v2: removed unnecessary direction_input callback, minor formatting cleanup
--- arch/arm/mach-s3c2410/h1940-bluetooth.c | 13 ++++- arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 57 ++++++------------- arch/arm/mach-s3c2410/mach-h1940.c | 64 ++++++++++++++++++++-- arch/arm/plat-s3c24xx/Kconfig | 1 + 4 files changed, 87 insertions(+), 48 deletions(-)
arch/arm/mach-s3c2410/h1940-bluetooth.c +10 -3
@@ -30,7 +30,7 @@ static void h1940bt_enable(int on) {if (on) {/* Power on the chip */ -h1940_latch_control (0 ,H1940_LATCH_BLUETOOTH_POWER ); +gpio_set_value (H1940_LATCH_BLUETOOTH_POWER ,1 );/* Reset the chip */ mdelay (10 );
@@ -43,7 +43,7 @@ static void h1940bt_enable(int on)mdelay (10 );gpio_set_value (S3C2410_GPH (1 ),0 );mdelay (10 ); -h1940_latch_control (H1940_LATCH_BLUETOOTH_POWER ,0 ); +gpio_set_value (H1940_LATCH_BLUETOOTH_POWER ,0 ); } }
@@ -64,7 +64,14 @@ static int __devinit h1940bt_probe(struct platform_device *pdev) ret =gpio_request (S3C2410_GPH (1 ),dev_name (&pdev->dev));if (ret) { -dev_err (&pdev->dev,"could not get GPH1\n" );\ +dev_err (&pdev->dev,"could not get GPH1\n" ); +return ret; + } + + ret =gpio_request (H1940_LATCH_BLUETOOTH_POWER ,dev_name (&pdev->dev)); +if (ret) { +gpio_free (S3C2410_GPH (1 )); +dev_err (&pdev->dev,"could not get BT_POWER\n" );return ret; }
arch/arm/mach-s3c2410/include/mach/h1940-latch.h +18 -39
69 lines not on this page · raw message
arch/arm/mach-s3c2410/mach-h1940.c +58 -6
105 lines not on this page · raw message
arch/arm/plat-s3c24xx/Kconfig +1 -0
@@ -69,6 +69,7 @@ config S3C24XX_GPIO_EXTRA int default 128 if S3C24XX_GPIO_EXTRA128 default 64 if S3C24XX_GPIO_EXTRA64 + default 16 if ARCH_H1940 default 0 config S3C24XX_GPIO_EXTRA64
Signature · 1 line
1.7.2.2
PATCH 2/5 h1940: fix h1940-bluetooth compilation
In reply to Vasily Khoruzhickh1940-bluetooth.c doesn't compile after s3c gpio API changes, this patch fixes issue.
--- arch/arm/mach-s3c2410/h1940-bluetooth.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-s3c2410/h1940-bluetooth.c +4 -4
@@ -77,13 +77,13 @@ static int __devinit h1940bt_probe(struct platform_device *pdev)/* Configures BT serial port GPIOs */ s3c_gpio_cfgpin (S3C2410_GPH (0 ), S3C2410_GPH0_nCTS0); -s3c_gpio_cfgpull (S3C2410_GPH (0 ),S3C_GPIO_PULL_NONE ); +s3c_gpio_setpull (S3C2410_GPH (0 ),S3C_GPIO_PULL_NONE );s3c_gpio_cfgpin (S3C2410_GPH (1 ),S3C2410_GPIO_OUTPUT ); -s3c_gpio_cfgpull (S3C2410_GPH (1 ),S3C_GPIO_PULL_NONE ); +s3c_gpio_setpull (S3C2410_GPH (1 ),S3C_GPIO_PULL_NONE );s3c_gpio_cfgpin (S3C2410_GPH (2 ),S3C2410_GPH2_TXD0 ); -s3c_gpio_cfgpull (S3C2410_GPH (2 ),S3C_GPIO_PULL_NONE ); +s3c_gpio_setpull (S3C2410_GPH (2 ),S3C_GPIO_PULL_NONE );s3c_gpio_cfgpin (S3C2410_GPH (3 ),S3C2410_GPH3_RXD0 ); -s3c_gpio_cfgpull (S3C2410_GPH (3 ),S3C_GPIO_PULL_NONE ); +s3c_gpio_setpull (S3C2410_GPH (3 ),S3C_GPIO_PULL_NONE ); rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH,
Signature · 1 line
1.7.2.2
Ben Dooks
AppliedPATCH 2/5 h1940: fix h1940-bluetooth compilation
Quoted 7 lines · Vasily Khoruzhick
h1940-bluetooth.cdoesn't compile after s3c gpio API changes, this patch fixes issue.Signed-off-by Vasily Khoruzhick <[email protected]>--- arch/arm/mach-s3c2410/h1940-bluetooth.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
thanks, applied to for-linus/2636/s3c24xx-fixes.
Signature · 1 line
Ben
PATCH 2/5 h1940: fix h1940-bluetooth compilation
In reply to Vasily KhoruzhickQuoted 2 lines · Vasily Khoruzhick
h1940-bluetooth.cdoesn't compile after s3c gpio API changes, this patch fixes issue.
As a note, in future it would be very useful to have the part of the build output showing the failure when submitting a bug fix like this.
PATCH 3/5 h1940: implement mmc_power function
In reply to Vasily Khoruzhick--- arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 23 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-)
arch/arm/mach-s3c2410/include/mach/h1940-latch.h +1 -1
@@ -35,7 +35,7 @@#define H1940_LATCH_AUDIO_POWER H1940_LATCH_GPIO(9)#define H1940_LATCH_SM803_ENABLE H1940_LATCH_GPIO(10)#define H1940_LATCH_LCD_P4 H1940_LATCH_GPIO(11) -#define H1940_LATCH_CPUQ5 H1940_LATCH_GPIO(12) +#define H1940_LATCH_SD_POWER H1940_LATCH_GPIO(12)#define H1940_LATCH_BLUETOOTH_POWER H1940_LATCH_GPIO(13)#define H1940_LATCH_LED_GREEN H1940_LATCH_GPIO(14)#define H1940_LATCH_LED_FLASH H1940_LATCH_GPIO(15)
arch/arm/mach-s3c2410/mach-h1940.c +20 -3
@@ -112,8 +112,7 @@ static unsigned int latch_state = H1940_LATCH_BIT(H1940_LATCH_LCD_P4) |H1940_LATCH_BIT (H1940_LATCH_LCD_P1 ) |H1940_LATCH_BIT (H1940_LATCH_LCD_P2 ) |H1940_LATCH_BIT (H1940_LATCH_LCD_P3 ) | -H1940_LATCH_BIT (H1940_LATCH_MAX1698_nSHUTDOWN) | -H1940_LATCH_BIT (H1940_LATCH_CPUQ5 ); +H1940_LATCH_BIT (H1940_LATCH_MAX1698_nSHUTDOWN);static void h1940_latch_control (unsigned int clear,unsigned int set) {
@@ -255,10 +254,25 @@ static struct platform_device h1940_device_bluetooth = { .id = -1, }; +static void h1940_set_mmc_power (unsigned char power_mode,unsigned short vdd) +{ +switch (power_mode) { +case MMC_POWER_OFF : +gpio_set_value (H1940_LATCH_SD_POWER ,0 ); +break ; +case MMC_POWER_UP : +case MMC_POWER_ON : +gpio_set_value (H1940_LATCH_SD_POWER ,1 ); +break ; +default : +break ; + }; +} +static struct s3c24xx_mci_pdata h1940_mmc_cfg__initdata = { .gpio_detect =S3C2410_GPF (5 ), .gpio_wprotect =S3C2410_GPH (8 ), - .set_power =NULL , + .set_power = h1940_set_mmc_power, .ocr_avail =MMC_VDD_32_33 , };
@@ -405,6 +419,9 @@ static void __init h1940_init(void)gpio_request (H1940_LATCH_USB_DP ,"USB pullup" );gpio_direction_output (H1940_LATCH_USB_DP ,0 ); +gpio_request (H1940_LATCH_SD_POWER ,"SD power" ); +gpio_direction_output (H1940_LATCH_SD_POWER ,0 ); +platform_add_devices (h1940_devices,ARRAY_SIZE (h1940_devices)); }
Signature · 1 line
1.7.2.2
PATCH 3/5 h1940: implement mmc_power function
On 07/09/10 16:00, Vasily Khoruzhick wrote:
This has zero description other than the title. It would be useful to have a better descriptive text.
I'll apply this to my next tree anyway and await a better title to apply to it.
PATCH v2 3/5 h1940: implement mmc_power function
This patch implements h1940-specific set_power callback for s3cmci driver, so card power can be disabled when card is not inserted or before suspend. Without this patch PDA consumes power in suspend when card is inserted.
---
v2: Add description to patch
arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 23 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-)
arch/arm/mach-s3c2410/include/mach/h1940-latch.h +1 -1
@@ -35,7 +35,7 @@#define H1940_LATCH_AUDIO_POWER H1940_LATCH_GPIO(9)#define H1940_LATCH_SM803_ENABLE H1940_LATCH_GPIO(10)#define H1940_LATCH_LCD_P4 H1940_LATCH_GPIO(11) -#define H1940_LATCH_CPUQ5 H1940_LATCH_GPIO(12) +#define H1940_LATCH_SD_POWER H1940_LATCH_GPIO(12)#define H1940_LATCH_BLUETOOTH_POWER H1940_LATCH_GPIO(13)#define H1940_LATCH_LED_GREEN H1940_LATCH_GPIO(14)#define H1940_LATCH_LED_FLASH H1940_LATCH_GPIO(15)
arch/arm/mach-s3c2410/mach-h1940.c +20 -3
@@ -112,8 +112,7 @@ static unsigned int latch_state = H1940_LATCH_BIT(H1940_LATCH_LCD_P4) |H1940_LATCH_BIT (H1940_LATCH_LCD_P1 ) |H1940_LATCH_BIT (H1940_LATCH_LCD_P2 ) |H1940_LATCH_BIT (H1940_LATCH_LCD_P3 ) | -H1940_LATCH_BIT (H1940_LATCH_MAX1698_nSHUTDOWN) | -H1940_LATCH_BIT (H1940_LATCH_CPUQ5 ); +H1940_LATCH_BIT (H1940_LATCH_MAX1698_nSHUTDOWN);static void h1940_latch_control (unsigned int clear,unsigned int set) {
@@ -247,10 +246,25 @@ static struct platform_device h1940_device_bluetooth = { .id = -1, }; +static void h1940_set_mmc_power (unsigned char power_mode,unsigned short vdd) +{ +switch (power_mode) { +case MMC_POWER_OFF : +gpio_set_value (H1940_LATCH_SD_POWER ,0 ); +break ; +case MMC_POWER_UP : +case MMC_POWER_ON : +gpio_set_value (H1940_LATCH_SD_POWER ,1 ); +break ; +default : +break ; + }; +} +static struct s3c24xx_mci_pdata h1940_mmc_cfg__initdata = { .gpio_detect =S3C2410_GPF (5 ), .gpio_wprotect =S3C2410_GPH (8 ), - .set_power =NULL , + .set_power = h1940_set_mmc_power, .ocr_avail =MMC_VDD_32_33 , };
@@ -397,6 +411,9 @@ static void __init h1940_init(void)gpio_request (H1940_LATCH_USB_DP ,"USB pullup" );gpio_direction_output (H1940_LATCH_USB_DP ,0 ); +gpio_request (H1940_LATCH_SD_POWER ,"SD power" ); +gpio_direction_output (H1940_LATCH_SD_POWER ,0 ); +platform_add_devices (h1940_devices,ARRAY_SIZE (h1940_devices)); }
Signature · 1 line
1.7.3
PATCH 4/5 h1940: Fix backlight and LCD power functions
In reply to Vasily Khoruzhick--- arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 68 ++++++++++++++++++---- 2 files changed, 58 insertions(+), 12 deletions(-)
arch/arm/mach-s3c2410/include/mach/h1940-latch.h +1 -1
@@ -20,7 +20,7 @@/* SD layer latch */ -#define H1940_LATCH_SDQ1 H1940_LATCH_GPIO(0) +#define H1940_LATCH_LCD_P0 H1940_LATCH_GPIO(0)#define H1940_LATCH_LCD_P1 H1940_LATCH_GPIO(1)#define H1940_LATCH_LCD_P2 H1940_LATCH_GPIO(2)#define H1940_LATCH_LCD_P3 H1940_LATCH_GPIO(3)
arch/arm/mach-s3c2410/mach-h1940.c +57 -11
124 lines not on this page · raw message
Signature · 1 line
1.7.2.2
PATCH v2 4/5 h1940: Fix backlight and LCD power functions
v2: init gpio mode/value right after gpio_request
--- arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 80 ++++++++++++++++++---- 2 files changed, 66 insertions(+), 16 deletions(-)
arch/arm/mach-s3c2410/include/mach/h1940-latch.h +1 -1
@@ -20,7 +20,7 @@/* SD layer latch */ -#define H1940_LATCH_SDQ1 H1940_LATCH_GPIO(0) +#define H1940_LATCH_LCD_P0 H1940_LATCH_GPIO(0)#define H1940_LATCH_LCD_P1 H1940_LATCH_GPIO(1)#define H1940_LATCH_LCD_P2 H1940_LATCH_GPIO(2)#define H1940_LATCH_LCD_P3 H1940_LATCH_GPIO(3)
arch/arm/mach-s3c2410/mach-h1940.c +65 -15
133 lines not on this page · raw message
Signature · 1 line
1.7.2.2
PATCH v2 4/5 h1940: Fix backlight and LCD power functions
On 11/09/10 22:45, Vasily Khoruzhick wrote:
Could I have a better explanation of what this part is doing please.
for future reference, you don't need to put 'this patch' in the description, that part is pretty clear.
Quoted 1 line
v2: init gpio mode/value right after
gpio_request
It would be helpful to move the changes between submisisons to under the --- lines to make them easier to remove when applying to the tree.
Quoted 5 lines
Signed-off-by Vasily Khoruzhick <[email protected]>--- arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 80 ++++++++++++++++++---- 2 files changed, 66 insertions(+), 16 deletions(-)
PATCH v3 4/5 h1940: Fix backlight and LCD power functions
Current implementation of LCD and backlight power control functions is not complete, as result PDA consumes power in suspend. Fix this issue by managing state of some latch bits, just like WinMobile does.
---
v2: init gpio mode/value right after gpio_request
v3: add verbose comnent to patch
arch/arm/mach-s3c2410/include/mach/h1940-latch.h | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 80 ++++++++++++++++++---- 2 files changed, 66 insertions(+), 16 deletions(-)
arch/arm/mach-s3c2410/include/mach/h1940-latch.h +1 -1
@@ -20,7 +20,7 @@/* SD layer latch */ -#define H1940_LATCH_SDQ1 H1940_LATCH_GPIO(0) +#define H1940_LATCH_LCD_P0 H1940_LATCH_GPIO(0)#define H1940_LATCH_LCD_P1 H1940_LATCH_GPIO(1)#define H1940_LATCH_LCD_P2 H1940_LATCH_GPIO(2)#define H1940_LATCH_LCD_P3 H1940_LATCH_GPIO(3)
arch/arm/mach-s3c2410/mach-h1940.c +65 -15
133 lines not on this page · raw message
Signature · 1 line
1.7.3
cover h1940 series
In reply to Vasily KhoruzhickQuoted 3 lines · Vasily Khoruzhick
This series converts latch API to generic gpiolib API, improves power management and adds sound codec device for h1940.
few minor bits with the gpiolib. otherwise looks ok.