diff options
| author | Doug Zobel <dzobel1@motorola.com> | 2013-11-15 14:29:07 -0600 |
|---|---|---|
| committer | James Wylder <jwylder@motorola.com> | 2014-03-05 17:46:52 -0600 |
| commit | d2a782003a6047da120a33e6f8ee6fd33bb825d6 (patch) | |
| tree | 8d20bd4ecda62a06e98993c4108456bc1acb0d0b /arch/arm/mach-omap2/board-minnow-wireless.c | |
| parent | 32fd2d36d2464056d4522a9c02797b7c2b2e884f (diff) | |
| download | olio-linux-3.10-d2a782003a6047da120a33e6f8ee6fd33bb825d6.tar.xz olio-linux-3.10-d2a782003a6047da120a33e6f8ee6fd33bb825d6.zip | |
CW integration and minnow bringup
* create minnow machine type
* create Android makefile
* add pre-commit syntax check
* enable -Werror
* Add drivers: CPCAP, TPS65xxx, m4sensorhub, atmxt, lm3535,
usb gadget, minnow display, TI 12xx wireless
Change-Id: I7962f5e1256715f2452aed5a62a4f2f2383d5046
Diffstat (limited to 'arch/arm/mach-omap2/board-minnow-wireless.c')
| -rw-r--r-- | arch/arm/mach-omap2/board-minnow-wireless.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-minnow-wireless.c b/arch/arm/mach-omap2/board-minnow-wireless.c new file mode 100644 index 00000000000..672917cfff3 --- /dev/null +++ b/arch/arm/mach-omap2/board-minnow-wireless.c @@ -0,0 +1,104 @@ +/* + * linux/arch/arm/mach-omap2/board-minnow-wireless.c + * + * Copyright (C) 2013 Motorola Mobility, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/wl127x-rfkill.h> +#include "common.h" + + + +void change_vio_mode(int source, int value) +{ + printk(KERN_DEBUG "Entering change_vio_mode\n"); +#if 0 + static int bt_request; + static int wifi_request; + + /*If have DC-DC converter, skip it*/ + if (misc_cpcap == NULL) + return; + + mutex_lock(&vio_access); + if (source == 0) + bt_request = value; + else if (source == 1) + wifi_request = value; + else { + printk(KERN_ERR "unknown source to vio "); + mutex_unlock(&vio_access); + return; + } + + if (bt_request | wifi_request) + cpcap_regacc_write(misc_cpcap, CPCAP_REG_S3C, + 0, CPCAP_BIT_SW3STBY); + else + cpcap_regacc_write(misc_cpcap, CPCAP_REG_S3C, + CPCAP_BIT_SW3STBY, CPCAP_BIT_SW3STBY); + + mutex_unlock(&vio_access); +#endif +} + + +static int minnow_wl1271_init(void); +static int minnow_wl1271_release(void); +static int minnow_wl1271_enable(void); +static int minnow_wl1271_disable(void); + +static struct wl127x_rfkill_platform_data minnow_wl1271_pdata = { + .bt_nshutdown_gpio = -1, + .fm_enable_gpio = -1, + .bt_hw_init = minnow_wl1271_init, + .bt_hw_release = minnow_wl1271_release, + .bt_hw_enable = minnow_wl1271_enable, + .bt_hw_disable = minnow_wl1271_disable, +}; + +static int minnow_wl1271_init(void) +{ + return 0; +} + +static int minnow_wl1271_release(void) +{ + return 0; +} + +static int minnow_wl1271_enable(void) +{ + /* FIXME + * Change vio mode dynamically if necessary + */ + change_vio_mode(0, 1); + return 0; +} + +static int minnow_wl1271_disable(void) +{ + /* FIXME + * Change vio mode dynamically if necessary + */ + change_vio_mode(0, 0); + return 0; +} + +static struct platform_device minnow_wl1271_device = { + .name = "wl127x-rfkill", + .id = 0, + .dev.platform_data = &minnow_wl1271_pdata, +}; + +void __init minnow_bt_init(void) +{ + /* TODO use device tree once ported */ + minnow_wl1271_pdata.bt_nshutdown_gpio = 83; + + platform_device_register(&minnow_wl1271_device); +} |