diff options
Diffstat (limited to 'arch/arm/mach-s3c2410/h1940-bluetooth.c')
-rw-r--r-- | arch/arm/mach-s3c2410/h1940-bluetooth.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c index a3f3c7b1ca38..8cdeb14af592 100644 --- a/arch/arm/mach-s3c2410/h1940-bluetooth.c +++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c | |||
@@ -33,14 +33,15 @@ static void h1940bt_enable(int on) | |||
33 | h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); | 33 | h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); |
34 | /* Reset the chip */ | 34 | /* Reset the chip */ |
35 | mdelay(10); | 35 | mdelay(10); |
36 | s3c2410_gpio_setpin(S3C2410_GPH(1), 1); | 36 | |
37 | gpio_set_value(S3C2410_GPH(1), 1); | ||
37 | mdelay(10); | 38 | mdelay(10); |
38 | s3c2410_gpio_setpin(S3C2410_GPH(1), 0); | 39 | gpio_set_value(S3C2410_GPH(1), 0); |
39 | } | 40 | } |
40 | else { | 41 | else { |
41 | s3c2410_gpio_setpin(S3C2410_GPH(1), 1); | 42 | gpio_set_value(S3C2410_GPH(1), 1); |
42 | mdelay(10); | 43 | mdelay(10); |
43 | s3c2410_gpio_setpin(S3C2410_GPH(1), 0); | 44 | gpio_set_value(S3C2410_GPH(1), 0); |
44 | mdelay(10); | 45 | mdelay(10); |
45 | h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); | 46 | h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); |
46 | } | 47 | } |
@@ -61,15 +62,21 @@ static int __devinit h1940bt_probe(struct platform_device *pdev) | |||
61 | struct rfkill *rfk; | 62 | struct rfkill *rfk; |
62 | int ret = 0; | 63 | int ret = 0; |
63 | 64 | ||
65 | ret = gpio_request(S3C2410_GPH(1), dev_name(&pdev->dev)); | ||
66 | if (ret) { | ||
67 | dev_err(&pdev->dev, "could not get GPH1\n");\ | ||
68 | return ret; | ||
69 | } | ||
70 | |||
64 | /* Configures BT serial port GPIOs */ | 71 | /* Configures BT serial port GPIOs */ |
65 | s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); | 72 | s3c_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); |
66 | s3c2410_gpio_pullup(S3C2410_GPH(0), 1); | 73 | s3c_gpio_cfgpull(S3C2410_GPH(0), S3C_GPIO_PULL_NONE); |
67 | s3c2410_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT); | 74 | s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT); |
68 | s3c2410_gpio_pullup(S3C2410_GPH(1), 1); | 75 | s3c_gpio_cfgpull(S3C2410_GPH(1), S3C_GPIO_PULL_NONE); |
69 | s3c2410_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0); | 76 | s3c_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0); |
70 | s3c2410_gpio_pullup(S3C2410_GPH(2), 1); | 77 | s3c_gpio_cfgpull(S3C2410_GPH(2), S3C_GPIO_PULL_NONE); |
71 | s3c2410_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); | 78 | s3c_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); |
72 | s3c2410_gpio_pullup(S3C2410_GPH(3), 1); | 79 | s3c_gpio_cfgpull(S3C2410_GPH(3), S3C_GPIO_PULL_NONE); |
73 | 80 | ||
74 | 81 | ||
75 | rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH, | 82 | rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH, |
@@ -100,6 +107,7 @@ static int h1940bt_remove(struct platform_device *pdev) | |||
100 | struct rfkill *rfk = platform_get_drvdata(pdev); | 107 | struct rfkill *rfk = platform_get_drvdata(pdev); |
101 | 108 | ||
102 | platform_set_drvdata(pdev, NULL); | 109 | platform_set_drvdata(pdev, NULL); |
110 | gpio_free(S3C2410_GPH(1)); | ||
103 | 111 | ||
104 | if (rfk) { | 112 | if (rfk) { |
105 | rfkill_unregister(rfk); | 113 | rfkill_unregister(rfk); |