ARM: H1940: Change h1940-bluetooth to use gpiolib API

Change the h1940-bluetooth driver to use gpiolib to set the output state
of GPH1.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
This commit is contained in:
Ben Dooks 2010-05-04 11:23:05 +09:00
parent 7ced5eab39
commit f4146a65fb

View File

@ -33,14 +33,15 @@ static void h1940bt_enable(int on)
h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER);
/* Reset the chip */ /* Reset the chip */
mdelay(10); mdelay(10);
s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
gpio_set_value(S3C2410_GPH(1), 1);
mdelay(10); mdelay(10);
s3c2410_gpio_setpin(S3C2410_GPH(1), 0); gpio_set_value(S3C2410_GPH(1), 0);
} }
else { else {
s3c2410_gpio_setpin(S3C2410_GPH(1), 1); gpio_set_value(S3C2410_GPH(1), 1);
mdelay(10); mdelay(10);
s3c2410_gpio_setpin(S3C2410_GPH(1), 0); gpio_set_value(S3C2410_GPH(1), 0);
mdelay(10); mdelay(10);
h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0);
} }
@ -61,6 +62,12 @@ static int __devinit h1940bt_probe(struct platform_device *pdev)
struct rfkill *rfk; struct rfkill *rfk;
int ret = 0; int ret = 0;
ret = gpio_request(S3C2410_GPH(1), dev_name(&pdev->dev));
if (ret) {
dev_err(&pdev->dev, "could not get GPH1\n");\
return ret;
}
/* Configures BT serial port GPIOs */ /* Configures BT serial port GPIOs */
s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0);
s3c2410_gpio_pullup(S3C2410_GPH(0), 1); s3c2410_gpio_pullup(S3C2410_GPH(0), 1);
@ -100,6 +107,7 @@ static int h1940bt_remove(struct platform_device *pdev)
struct rfkill *rfk = platform_get_drvdata(pdev); struct rfkill *rfk = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
gpio_free(S3C2410_GPH(1));
if (rfk) { if (rfk) {
rfkill_unregister(rfk); rfkill_unregister(rfk);