]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: EXYNOS: Enable Bluetooth on ORIGEN
authorSangwook Lee <sangwook.lee@linaro.org>
Thu, 3 Nov 2011 07:14:14 +0000 (16:14 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Tue, 8 Nov 2011 10:55:19 +0000 (19:55 +0900)
This patch enables Bluetooth support on ORIGEN board.

Signed-off-by: Sangwook <sangwook.lee@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-exynos/mach-origen.c

index f80b563f2be7841d3fc2bb939d0bb20d513b86ae..f56d02705e0a4d50706e43568e16f02c4e8562f6 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/mfd/max8997.h>
 #include <linux/lcd.h>
+#include <linux/rfkill-gpio.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -232,6 +233,7 @@ static struct regulator_init_data __initdata max8997_ldo9_data = {
                .min_uV         = 2800000,
                .max_uV         = 2800000,
                .apply_uV       = 1,
+               .always_on      = 1,
                .valid_ops_mask = REGULATOR_CHANGE_STATUS,
                .state_mem      = {
                        .disabled       = 1,
@@ -275,6 +277,7 @@ static struct regulator_init_data __initdata max8997_ldo14_data = {
                .min_uV         = 1800000,
                .max_uV         = 1800000,
                .apply_uV       = 1,
+               .always_on      = 1,
                .valid_ops_mask = REGULATOR_CHANGE_STATUS,
                .state_mem      = {
                        .disabled       = 1,
@@ -290,6 +293,7 @@ static struct regulator_init_data __initdata max8997_ldo17_data = {
                .min_uV         = 3300000,
                .max_uV         = 3300000,
                .apply_uV       = 1,
+               .always_on      = 1,
                .valid_ops_mask = REGULATOR_CHANGE_STATUS,
                .state_mem      = {
                        .disabled       = 1,
@@ -588,6 +592,23 @@ static struct s3c_fb_platdata origen_lcd_pdata __initdata = {
        .setup_gpio     = exynos4_fimd0_gpio_setup_24bpp,
 };
 
+/* Bluetooth rfkill gpio platform data */
+struct rfkill_gpio_platform_data origen_bt_pdata = {
+       .reset_gpio     = EXYNOS4_GPX2(2),
+       .shutdown_gpio  = -1,
+       .type           = RFKILL_TYPE_BLUETOOTH,
+       .name           = "origen-bt",
+};
+
+/* Bluetooth Platform device */
+static struct platform_device origen_device_bluetooth = {
+       .name           = "rfkill_gpio",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &origen_bt_pdata,
+       },
+};
+
 static struct platform_device *origen_devices[] __initdata = {
        &s3c_device_hsmmc2,
        &s3c_device_hsmmc0,
@@ -615,6 +636,7 @@ static struct platform_device *origen_devices[] __initdata = {
        &exynos4_device_pd[PD_MFC],
        &origen_device_gpiokeys,
        &origen_lcd_hv070wsa,
+       &origen_device_bluetooth,
 };
 
 /* LCD Backlight data */
@@ -628,6 +650,16 @@ static struct platform_pwm_backlight_data origen_bl_data = {
        .pwm_period_ns  = 1000,
 };
 
+static void __init origen_bt_setup(void)
+{
+       gpio_request(EXYNOS4_GPA0(0), "GPIO BT_UART");
+       /* 4 UART Pins configuration */
+       s3c_gpio_cfgrange_nopull(EXYNOS4_GPA0(0), 4, S3C_GPIO_SFN(2));
+       /* Setup BT Reset, this gpio will be requesed by rfkill-gpio */
+       s3c_gpio_cfgpin(EXYNOS4_GPX2(2), S3C_GPIO_OUTPUT);
+       s3c_gpio_setpull(EXYNOS4_GPX2(2), S3C_GPIO_PULL_NONE);
+}
+
 static void s5p_tv_setup(void)
 {
        /* Direct HPD to HDMI chip */
@@ -687,6 +719,8 @@ static void __init origen_machine_init(void)
        s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
 
        samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data);
+
+       origen_bt_setup();
 }
 
 MACHINE_START(ORIGEN, "ORIGEN")