arm: tegra: use rfkill-gpio driver to register bluetooth rfkill
Nagarjuna Kristam [Mon, 4 Jun 2012 04:30:53 +0000 (09:30 +0530)]
rfkill-gpio driver is available in linux delivery as a generic rfkill driver.
use rfkill-gpio driver to perform bluetooth RFKILL gpio activities, instead of
bcm4329 rfkill driver.

Bug 993990
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>

Change-Id: I654b93f099431029177913605d15ad921df07833
Reviewed-on: http://git-master/r/108499
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/configs/tegra3_android_defconfig
arch/arm/configs/tegra_android_defconfig
arch/arm/mach-tegra/board-cardhu.c
arch/arm/mach-tegra/board-enterprise.c
arch/arm/mach-tegra/board-ventana.c
arch/arm/mach-tegra/board-whistler.c

index 809542d..a2b7cc1 100644 (file)
@@ -180,6 +180,7 @@ CONFIG_NL80211_TESTMODE=y
 CONFIG_LIB80211=m
 CONFIG_MAC80211=m
 CONFIG_RFKILL=y
+CONFIG_RFKILL_GPIO=y
 CONFIG_CAIF=y
 CONFIG_NFC=y
 CONFIG_PN544_NFC=y
@@ -191,7 +192,7 @@ CONFIG_AD525X_DPOT_I2C=y
 CONFIG_APDS9802ALS=y
 CONFIG_SENSORS_NCT1008=y
 CONFIG_UID_STAT=y
-CONFIG_BCM4329_RFKILL=y
+# CONFIG_BCM4329_RFKILL is not set
 CONFIG_TEGRA_CRYPTO_DEV=y
 CONFIG_MAX1749_VIBRATOR=y
 CONFIG_EEPROM_AT24=y
index 3d1780c..eb6abec 100644 (file)
@@ -170,6 +170,7 @@ CONFIG_BT_HCIUART_LL=y
 CONFIG_BT_BLUESLEEP=y
 CONFIG_CFG80211=y
 CONFIG_RFKILL=y
+CONFIG_RFKILL_GPIO=y
 # CONFIG_FIRMWARE_IN_KERNEL is not set
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_MISC_DEVICES=y
@@ -178,7 +179,7 @@ CONFIG_AD525X_DPOT_I2C=y
 CONFIG_APDS9802ALS=y
 CONFIG_SENSORS_NCT1008=y
 CONFIG_UID_STAT=y
-CONFIG_BCM4329_RFKILL=y
+# CONFIG_BCM4329_RFKILL is not set
 CONFIG_TEGRA_CRYPTO_DEV=y
 CONFIG_MAX1749_VIBRATOR=y
 CONFIG_MPU_SENSORS_TIMERIRQ=y
index 6dc9b90..be1aeec 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/memblock.h>
 #include <linux/spi-tegra.h>
 #include <linux/nfc/pn544.h>
+#include <linux/rfkill-gpio.h>
 
 #include <sound/wm8903.h>
 #include <sound/max98095.h>
@@ -86,20 +87,21 @@ static struct tegra_thermal_data thermal_data = {
 #endif
 };
 
-static struct resource cardhu_bcm4329_rfkill_resources[] = {
+static struct rfkill_gpio_platform_data cardhu_bt_rfkill_pdata[] = {
        {
-               .name   = "bcm4329_nshutdown_gpio",
-               .start  = TEGRA_GPIO_PU0,
-               .end    = TEGRA_GPIO_PU0,
-               .flags  = IORESOURCE_IO,
+               .name           = "bt_rfkill",
+               .shutdown_gpio  = TEGRA_GPIO_PU0,
+               .reset_gpio     = TEGRA_GPIO_INVALID,
+               .type           = RFKILL_TYPE_BLUETOOTH,
        },
 };
 
-static struct platform_device cardhu_bcm4329_rfkill_device = {
-       .name = "bcm4329_rfkill",
+static struct platform_device cardhu_bt_rfkill_device = {
+       .name = "rfkill_gpio",
        .id             = -1,
-       .num_resources  = ARRAY_SIZE(cardhu_bcm4329_rfkill_resources),
-       .resource       = cardhu_bcm4329_rfkill_resources,
+       .dev = {
+               .platform_data = &cardhu_bt_rfkill_pdata,
+       },
 };
 
 static struct resource cardhu_bluesleep_resources[] = {
@@ -706,7 +708,7 @@ static struct platform_device *cardhu_devices[] __initdata = {
        &spdif_dit_device,
        &bluetooth_dit_device,
        &baseband_dit_device,
-       &cardhu_bcm4329_rfkill_device,
+       &cardhu_bt_rfkill_device,
        &tegra_pcm_device,
        &cardhu_audio_wm8903_device,
        &cardhu_audio_max98095_device,
index 2b5a725..316e41d 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/fsl_devices.h>
 #include <linux/i2c/atmel_mxt_ts.h>
 #include <linux/memblock.h>
+#include <linux/rfkill-gpio.h>
 
 #include <linux/nfc/pn544.h>
 #include <sound/max98088.h>
@@ -79,20 +80,21 @@ static struct tegra_thermal_data thermal_data = {
 #endif
 };
 
-static struct resource enterprise_bcm4329_rfkill_resources[] = {
+static struct rfkill_gpio_platform_data enterprise_bt_rfkill_pdata[] = {
        {
-               .name   = "bcm4329_nshutdown_gpio",
-               .start  = TEGRA_GPIO_PE6,
-               .end    = TEGRA_GPIO_PE6,
-               .flags  = IORESOURCE_IO,
+               .name           = "bt_rfkill",
+               .shutdown_gpio  = TEGRA_GPIO_PE6,
+               .reset_gpio     = TEGRA_GPIO_INVALID,
+               .type           = RFKILL_TYPE_BLUETOOTH,
        },
 };
 
-static struct platform_device enterprise_bcm4329_rfkill_device = {
-       .name = "bcm4329_rfkill",
+static struct platform_device enterprise_bt_rfkill_device = {
+       .name = "rfkill_gpio",
        .id             = -1,
-       .num_resources  = ARRAY_SIZE(enterprise_bcm4329_rfkill_resources),
-       .resource       = enterprise_bcm4329_rfkill_resources,
+       .dev = {
+               .platform_data = &enterprise_bt_rfkill_pdata,
+       },
 };
 
 static struct resource enterprise_bluesleep_resources[] = {
@@ -516,7 +518,7 @@ static struct platform_device *enterprise_devices[] __initdata = {
        &tegra_avp_device,
 #endif
        &tegra_camera,
-       &enterprise_bcm4329_rfkill_device,
+       &enterprise_bt_rfkill_device,
        &tegra_spi_device4,
        &tegra_hda_device,
 #if defined(CONFIG_CRYPTO_DEV_TEGRA_SE)
index 942ca44..c8c9ac4 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/memblock.h>
 #include <linux/i2c/atmel_mxt_ts.h>
 #include <linux/tegra_uart.h>
+#include <linux/rfkill-gpio.h>
 
 #include <sound/wm8903.h>
 
 #include "pm.h"
 
 
-static struct resource ventana_bcm4329_rfkill_resources[] = {
+static struct rfkill_gpio_platform_data ventana_bt_rfkill_pdata[] = {
        {
-               .name   = "bcm4329_nshutdown_gpio",
-               .start  = TEGRA_GPIO_PU0,
-               .end    = TEGRA_GPIO_PU0,
-               .flags  = IORESOURCE_IO,
+               .name           = "bt_rfkill",
+               .shutdown_gpio  = TEGRA_GPIO_PU0,
+               .reset_gpio     = TEGRA_GPIO_INVALID,
+               .type           = RFKILL_TYPE_BLUETOOTH,
        },
 };
 
-static struct platform_device ventana_bcm4329_rfkill_device = {
-       .name = "bcm4329_rfkill",
+static struct platform_device ventana_bt_rfkill_device = {
+       .name = "rfkill_gpio",
        .id             = -1,
-       .num_resources  = ARRAY_SIZE(ventana_bcm4329_rfkill_resources),
-       .resource       = ventana_bcm4329_rfkill_resources,
+       .dev = {
+               .platform_data  = ventana_bt_rfkill_pdata,
+       },
 };
 
 static void __init ventana_bt_rfkill(void)
 {
        /*Add Clock Resource*/
-       clk_add_alias("bcm4329_32k_clk", ventana_bcm4329_rfkill_device.name, \
+       clk_add_alias("bcm4329_32k_clk", ventana_bt_rfkill_device.name, \
                                "blink", NULL);
        return;
 }
@@ -380,7 +382,7 @@ static struct platform_device *ventana_devices[] __initdata = {
        &tegra_das_device,
        &spdif_dit_device,
        &bluetooth_dit_device,
-       &ventana_bcm4329_rfkill_device,
+       &ventana_bt_rfkill_device,
        &tegra_pcm_device,
        &ventana_audio_device,
 };
index 6156c8a..aa0e1c0 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/mfd/max8907c.h>
 #include <linux/memblock.h>
 #include <linux/tegra_uart.h>
+#include <linux/rfkill-gpio.h>
 
 #include <mach/clk.h>
 #include <mach/iomap.h>
@@ -169,21 +170,21 @@ static void __init whistler_uart_init(void)
        platform_add_devices(whistler_uart_devices,
                                ARRAY_SIZE(whistler_uart_devices));
 }
-
-static struct resource whistler_bcm4329_rfkill_resources[] = {
+static struct rfkill_gpio_platform_data whistler_bt_rfkill_pdata[] = {
        {
-               .name   = "bcm4329_nshutdown_gpio",
-               .start  = TEGRA_GPIO_PU0,
-               .end    = TEGRA_GPIO_PU0,
-               .flags  = IORESOURCE_IO,
+               .name           = "bt_rfkill",
+               .shutdown_gpio  = TEGRA_GPIO_PU0,
+               .reset_gpio     = TEGRA_GPIO_INVALID,
+               .type           = RFKILL_TYPE_BLUETOOTH,
        },
 };
 
-static struct platform_device whistler_bcm4329_rfkill_device = {
-       .name           = "bcm4329_rfkill",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(whistler_bcm4329_rfkill_resources),
-       .resource       = whistler_bcm4329_rfkill_resources,
+static struct platform_device whistler_bt_rfkill_device = {
+       .name = "rfkill_gpio",
+       .id   = -1,
+       .dev  = {
+               .platform_data  = whistler_bt_rfkill_pdata,
+       },
 };
 
 static struct resource whistler_bluesleep_resources[] = {
@@ -393,7 +394,7 @@ static struct platform_device *whistler_devices[] __initdata = {
        &spdif_dit_device,
        &bluetooth_dit_device,
        &baseband_dit_device,
-       &whistler_bcm4329_rfkill_device,
+       &whistler_bt_rfkill_device,
        &tegra_pcm_device,
        &whistler_audio_aic326x_device,
        &whistler_audio_wm8753_device,