diff options
author | merge <null@invalid> | 2008-11-27 08:37:56 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2008-11-27 08:37:56 +0000 |
commit | a560d8579b4b009f847972667b7597c89030e26c (patch) | |
tree | 31dc5e17d93057b2e9290720a8b1f453201dead2 /arch | |
parent | e21ce7019cc3b9495be8678ef2c41569cc03021e (diff) |
MERGE-via-balaji-tracking-hist-MERGE-via-stable-tracking-hist-config-gta02-uplevel-patch
balaji-tracking-hist top was MERGE-via-stable-tracking-hist-config-gta02-uplevel-patch / eb381acecca375d0a7b88cfe640504a8a1fa4c39 ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-config-gta02-uplevel-patch
stable-tracking-hist top was config-gta02-uplevel-patch / 0e07e39074bbdb938cfefaea6ad7823282cc914c ... parent commitmessage:
From: Andy Green <andy@openmoko.com>
config-gta02-uplevel.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/configs/gta02-moredrivers-defconfig | 7 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/Kconfig | 6 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/neo1973_pm_bt.c | 59 |
3 files changed, 70 insertions, 2 deletions
diff --git a/arch/arm/configs/gta02-moredrivers-defconfig b/arch/arm/configs/gta02-moredrivers-defconfig index ef68a69eee9..823a3da8339 100644 --- a/arch/arm/configs/gta02-moredrivers-defconfig +++ b/arch/arm/configs/gta02-moredrivers-defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.28-rc4 -# Thu Nov 20 09:10:06 2008 +# Thu Nov 27 08:12:15 2008 # CONFIG_ARM=y CONFIG_HAVE_PWM=y @@ -628,7 +628,9 @@ CONFIG_WIRELESS_EXT=y CONFIG_WIRELESS_EXT_SYSFS=y # CONFIG_MAC80211 is not set # CONFIG_IEEE80211 is not set -# CONFIG_RFKILL is not set +CONFIG_RFKILL=y +CONFIG_RFKILL_INPUT=y +CONFIG_RFKILL_LEDS=y # CONFIG_NET_9P is not set # @@ -875,6 +877,7 @@ CONFIG_USB_ARMLINUX=y CONFIG_USB_EPSON2888=y CONFIG_USB_KC2190=y CONFIG_USB_NET_ZAURUS=m +# CONFIG_USB_HSO is not set # CONFIG_WAN is not set CONFIG_PPP=m CONFIG_PPP_MULTILINK=y diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig index 54b0ec4fa62..1bd3141a1d8 100644 --- a/arch/arm/plat-s3c24xx/Kconfig +++ b/arch/arm/plat-s3c24xx/Kconfig @@ -83,4 +83,10 @@ config MACH_SMDK help Common machine code for SMDK2410 and SMDK2440 +config MACH_NEO1973 + bool + select RFKILL + help + Common machine code for Neo1973 hardware + endif diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c index d3a046cada1..336c61e443c 100644 --- a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c +++ b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c @@ -15,6 +15,7 @@ #include <linux/init.h> #include <linux/kernel.h> #include <linux/platform_device.h> +#include <linux/rfkill.h> #include <linux/err.h> #include <mach/hardware.h> @@ -70,6 +71,41 @@ static ssize_t bt_read(struct device *dev, struct device_attribute *attr, } } +static int bt_rfkill_toggle_radio(void *data, enum rfkill_state state) +{ + struct device *dev = data; + unsigned long on = (state == RFKILL_STATE_ON); + unsigned int vol; + + if (machine_is_neo1973_gta01()) { + /* if we are powering up, assert reset, then power, + * then release reset */ + if (on) { + neo1973_gpb_setpin(GTA01_GPIO_BT_EN, 0); + pcf50606_voltage_set(pcf50606_global, + PCF50606_REGULATOR_D1REG, + 3100); + } + pcf50606_onoff_set(pcf50606_global, + PCF50606_REGULATOR_D1REG, on); + neo1973_gpb_setpin(GTA01_GPIO_BT_EN, on); + } else if (machine_is_neo1973_gta02()) { + if (s3c2410_gpio_getpin(GTA02_GPIO_BT_EN) == on) + return 0; + neo1973_gpb_setpin(GTA02_GPIO_BT_EN, !on); + pcf50633_voltage_set(pcf50633_global, + PCF50633_REGULATOR_LDO4, on ? 3200 : 0); + pcf50633_onoff_set(pcf50633_global, + PCF50633_REGULATOR_LDO4, on); + vol = pcf50633_voltage_get(pcf50633_global, + PCF50633_REGULATOR_LDO4); + dev_info(dev, "GTA02 Set PCF50633 LDO4 = %d\n", vol); + neo1973_gpb_setpin(GTA02_GPIO_BT_EN, on); + } + + return 0; +} + static ssize_t bt_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -79,6 +115,11 @@ static ssize_t bt_write(struct device *dev, struct device_attribute *attr, struct regulator *regulator; if (!strcmp(attr->attr.name, "power_on")) { + struct rfkill *rfkill = dev_get_drvdata(dev); + enum rfkill_state state = on ? RFKILL_STATE_ON : RFKILL_STATE_OFF; + bt_rfkill_toggle_radio(dev, state); + rfkill->state = state; + if (machine_is_neo1973_gta01()) { /* if we are powering up, assert reset, then power, * then release reset */ @@ -164,6 +205,7 @@ static struct attribute_group gta01_bt_attr_group = { static int __init gta01_bt_probe(struct platform_device *pdev) { + struct rfkill *rfkill; struct regulator *regulator; struct gta01_pm_bt_data *bt_data; @@ -194,16 +236,32 @@ static int __init gta01_bt_probe(struct platform_device *pdev) neo1973_gpb_setpin(GTA02_GPIO_BT_EN, 0); } + rfkill = rfkill_allocate(&pdev->dev, RFKILL_TYPE_BLUETOOTH); + + rfkill->name = pdev->name; + rfkill->data = pdev; + rfkill->state = -1; + rfkill->toggle_radio = bt_rfkill_toggle_radio; + + rfkill_register(rfkill); + + platform_set_drvdata(pdev, rfkill); + return sysfs_create_group(&pdev->dev.kobj, >a01_bt_attr_group); } static int gta01_bt_remove(struct platform_device *pdev) { + struct rfkill *rfkill = platform_get_drvdata(pdev); + struct gta01_pm_bt_data *bt_data; struct regulator *regulator; sysfs_remove_group(&pdev->dev.kobj, >a01_bt_attr_group); + rfkill_unregister(rfkill); + rfkill_free(rfkill); + bt_data = dev_get_drvdata(&pdev->dev); if (!bt_data || !bt_data->regulator) return 0; @@ -216,6 +274,7 @@ static int gta01_bt_remove(struct platform_device *pdev) regulator_put(regulator); +>>>>>>> patched return 0; } |