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 | |
| 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')
| -rw-r--r-- | arch/arm/mach-omap2/Kconfig | 6 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/Makefile | 5 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-minnow-cpcap-client.c | 50 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-minnow-sensors.c | 90 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-minnow-spi.c | 491 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-minnow-wireless.c | 104 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-minnow.c | 69 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-minnow.h | 22 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/dss-common.c | 26 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/dss-common.h | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/sdram-toshiba-hynix-numonyx.h | 66 |
11 files changed, 931 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index f49cd51e162..9b9c99c9f34 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -368,6 +368,12 @@ config MACH_OMAP_3630SDP default y select OMAP_PACKAGE_CBP +config MACH_MINNOW + bool "Motorola Minnow Product" + depends on ARCH_OMAP3 + default y + select OMAP_PACKAGE_CBP + config MACH_TI8168EVM bool "TI8168 Evaluation Module" depends on SOC_TI81XX diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 55a9d677768..9fe571fe9de 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -253,6 +253,11 @@ obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o obj-$(CONFIG_MACH_TOUCHBOOK) += board-omap3touchbook.o obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o +obj-$(CONFIG_MACH_MINNOW) += board-minnow.o \ + board-minnow-spi.o \ + board-minnow-wireless.o \ + board-minnow-sensors.o \ + board-minnow-cpcap-client.o obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o diff --git a/arch/arm/mach-omap2/board-minnow-cpcap-client.c b/arch/arm/mach-omap2/board-minnow-cpcap-client.c new file mode 100644 index 00000000000..b2fd25f8ce3 --- /dev/null +++ b/arch/arm/mach-omap2/board-minnow-cpcap-client.c @@ -0,0 +1,50 @@ +/* + * arch/arm/mach-omap2/board-minnow-cpcap-client.c + * + * Copyright (C) 2009-2010 Motorola, 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/kernel.h> +#include <linux/device.h> +#include <linux/irq.h> +#include <linux/platform_device.h> +#include <linux/spi/cpcap.h> +#include <omap34xx.h> + +/* + * CPCAP devcies are common for different HW Rev. + * + */ + + +static struct platform_device cpcap_usb_device = { + .name = "cpcap_usb", + .id = -1, + .dev.platform_data = NULL, +}; +static struct platform_device cpcap_usb_det_device = { + .name = "cpcap_usb_det", + .id = -1, + .dev = { + .platform_data = NULL, + }, +}; + +static struct platform_device *cpcap_devices[] = { + &cpcap_usb_device, + &cpcap_usb_det_device, +}; + + +void __init minnow_cpcap_client_init(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(cpcap_devices); i++) + cpcap_device_register(cpcap_devices[i]); + +} diff --git a/arch/arm/mach-omap2/board-minnow-sensors.c b/arch/arm/mach-omap2/board-minnow-sensors.c new file mode 100644 index 00000000000..512c4448f1d --- /dev/null +++ b/arch/arm/mach-omap2/board-minnow-sensors.c @@ -0,0 +1,90 @@ +/* + * linux/arch/arm/mach-omap2/board-minnow-sensors.c + * + * Copyright (C) 2009 Google, Inc. + * Copyright (C) 2009-2012 Motorola, 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/delay.h> +#include <linux/kernel.h> +#include <linux/platform_device.h> + +#if defined(CONFIG_MFD_M4SENSORHUB) || defined(CONFIG_MFD_M4SENSORHUB_MODULE) +#include <linux/m4sensorhub.h> +#include <linux/m4sensorhub_gpio.h> +#endif +#include <linux/regulator/consumer.h> +#include <linux/vib-gpio.h> + +#include <linux/gpio.h> + +#ifdef CONFIG_ARM_OF +#include <mach/dt_path.h> +#include <asm/prom.h> +#endif + +static struct regulator *minnow_vibrator_regulator; +static int minnow_vibrator_initialization(void) +{ + struct regulator *reg; + reg = regulator_get(NULL, "vvib"); + if (IS_ERR(reg)) + return PTR_ERR(reg); + minnow_vibrator_regulator = reg; + return 0; +} + +static void minnow_vibrator_exit(void) +{ + regulator_put(minnow_vibrator_regulator); +} + +static int minnow_vibrator_power_on(void) +{ + if (minnow_vibrator_regulator) + return regulator_enable(minnow_vibrator_regulator); + return 0; +} + +static int minnow_vibrator_power_off(void) +{ + if (minnow_vibrator_regulator) + return regulator_disable(minnow_vibrator_regulator); + return 0; +} + +static struct vib_gpio_platform_data minnow_vib_gpio_data = { + .gpio = -1, + .max_timeout = 15000, + .active_low = 0, + .initial_vibrate = 0, + + .init = minnow_vibrator_initialization, + .exit = minnow_vibrator_exit, + .power_on = minnow_vibrator_power_on, + .power_off = minnow_vibrator_power_off, +}; + +static struct platform_device minnow_vib_gpio = { + .name = "vib-gpio", + .id = -1, + .dev = { + .platform_data = &minnow_vib_gpio_data, + }, +}; + + + +/* + * Sensors + */ + +void __init minnow_sensors_init(void) +{ + platform_device_register(&minnow_vib_gpio); +} diff --git a/arch/arm/mach-omap2/board-minnow-spi.c b/arch/arm/mach-omap2/board-minnow-spi.c new file mode 100644 index 00000000000..a00cb01c0d9 --- /dev/null +++ b/arch/arm/mach-omap2/board-minnow-spi.c @@ -0,0 +1,491 @@ +/* + * arch/arm/mach-omap2/board-minnow-spi.c + * + * Copyright (C) 2009-2010 Motorola, 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/kernel.h> +#include <linux/device.h> +#include <linux/gpio.h> +#include <linux/irq.h> +#include <linux/platform_device.h> +#include <linux/power_supply.h> +#include <linux/regulator/consumer.h> +#include <linux/regulator/driver.h> +#include <linux/regulator/machine.h> +#include <linux/spi/cpcap.h> +#include <linux/spi/spi.h> + +#include "mux.h" + +struct cpcap_spi_init_data minnow_cpcap_spi_init[CPCAP_REG_SIZE + 1] = { + {CPCAP_REG_ASSIGN1, 0x0101}, + {CPCAP_REG_ASSIGN2, 0x0000}, + {CPCAP_REG_ASSIGN3, 0x0000}, + {CPCAP_REG_ASSIGN4, 0x0000}, + {CPCAP_REG_ASSIGN5, 0x0000}, + {CPCAP_REG_ASSIGN6, 0x0000}, + {CPCAP_REG_UCC1, 0x0000}, + {CPCAP_REG_PC1, 0x010A}, + {CPCAP_REG_PC2, 0x0150}, + {CPCAP_REG_PGC, 0x0000}, + {CPCAP_REG_SDVSPLL, 0xDB14}, + {CPCAP_REG_SI2CC1, 0x0281}, + {CPCAP_REG_Si2CC2, 0x00C4}, + {CPCAP_REG_S1C1, 0x6438}, + {CPCAP_REG_S1C2, 0x3838}, + {CPCAP_REG_S2C1, 0x6434}, + {CPCAP_REG_S2C2, 0x3C14}, + {CPCAP_REG_S3C, 0x053B}, + {CPCAP_REG_S4C1, 0x4920}, + {CPCAP_REG_S4C2, 0x2020}, + {CPCAP_REG_S6C, 0x0000}, + {CPCAP_REG_VWLAN2C, 0x0001}, + {CPCAP_REG_VUSBINT1C, 0x0029}, + {CPCAP_REG_VUSBINT2C, 0x0029}, + {CPCAP_REG_VAUDIOC, 0x0060}, + {CPCAP_REG_CCCC2, 0x002B}, + {CPCAP_REG_ADCC1, 0x9000}, + {CPCAP_REG_ADCC2, 0x4136}, + {CPCAP_REG_USBC1, 0x1201}, + {CPCAP_REG_USBC3, 0x7DFB}, + {CPCAP_REG_UIER2, 0x001F}, + {CPCAP_REG_UIEF2, 0x001F}, + {CPCAP_REG_OWDC, 0x0003}, + {CPCAP_REG_GPIO0, 0x3004}, + {CPCAP_REG_GPIO1, 0x3004}, + {CPCAP_REG_GPIO2, 0x3204}, + {CPCAP_REG_GPIO3, 0x3008}, + {CPCAP_REG_GPIO4, 0x3204}, + {CPCAP_REG_GPIO5, 0x3008}, + {CPCAP_REG_GPIO6, 0x3004}, + {CPCAP_REG_MDLC, 0x3008}, + {CPCAP_REG_KLC, 0x0000}, + {CPCAP_REG_UNUSED, 0x0000}, +}; + +unsigned short cpcap_regulator_mode_values[CPCAP_NUM_REGULATORS] = { + [CPCAP_SW4] = 0x4900, + [CPCAP_SW5] = 0x0022, + [CPCAP_VCAM] = 0x0003, + [CPCAP_VCSI] = 0x0003, + [CPCAP_VDAC] = 0x0003, + [CPCAP_VDIG] = 0x0003, + [CPCAP_VFUSE] = 0x0080, + [CPCAP_VHVIO] = 0x0012, + [CPCAP_VSDIO] = 0x0003, + [CPCAP_VPLL] = 0x0042, + [CPCAP_VRF1] = 0x000C, + [CPCAP_VRF2] = 0x0003, + [CPCAP_VRFREF] = 0x0022, + [CPCAP_VWLAN1] = 0x0003, + [CPCAP_VWLAN2] = 0x000C, + [CPCAP_VSIM] = 0x0003, + [CPCAP_VSIMCARD] = 0x1E00, + [CPCAP_VVIB] = 0x0001, + [CPCAP_VUSB] = 0x000C, + [CPCAP_VAUDIO] = 0x0006, +}; + +unsigned short cpcap_regulator_off_mode_values[CPCAP_NUM_REGULATORS] = { + [CPCAP_SW4] = 0x0000, + [CPCAP_SW5] = 0x0000, + [CPCAP_VCAM] = 0x0000, + [CPCAP_VCSI] = 0x0000, + [CPCAP_VDAC] = 0x0000, + [CPCAP_VDIG] = 0x0000, + [CPCAP_VFUSE] = 0x0000, + [CPCAP_VHVIO] = 0x0000, + [CPCAP_VSDIO] = 0x0000, + [CPCAP_VPLL] = 0x0000, + [CPCAP_VRF1] = 0x0000, + [CPCAP_VRF2] = 0x0000, + [CPCAP_VRFREF] = 0x0000, + [CPCAP_VWLAN1] = 0x0000, + [CPCAP_VWLAN2] = 0x0000, + [CPCAP_VSIM] = 0x0000, + [CPCAP_VSIMCARD] = 0x0000, + [CPCAP_VVIB] = 0x0000, + [CPCAP_VUSB] = 0x0000, + [CPCAP_VAUDIO] = 0x0000, +}; + +#define CPCAP_GPIO 0 + +struct regulator_consumer_supply cpcap_sw4_consumers[] = { + REGULATOR_SUPPLY("sw4", NULL /* DSP */), +}; + +struct regulator_consumer_supply cpcap_sw5_consumers[] = { + REGULATOR_SUPPLY("sw5", NULL /* lighting_driver */), +}; + +struct regulator_consumer_supply cpcap_vcam_consumers[] = { + REGULATOR_SUPPLY("vcam", NULL /* cpcap_cam_device */), +}; + +struct regulator_consumer_supply cpcap_vhvio_consumers[] = { + REGULATOR_SUPPLY("vhvio", NULL /* lighting_driver */), +#if 0 + REGULATOR_SUPPLY("vhvio", NULL /* lighting_driver */), + REGULATOR_SUPPLY("vhvio", NULL /* magnetometer */), + REGULATOR_SUPPLY("vhvio", NULL /* light sensor */), + REGULATOR_SUPPLY("vhvio", NULL /* accelerometer */), + REGULATOR_SUPPLY("vhvio", NULL /* display */), +#endif +}; + +struct regulator_consumer_supply cpcap_vsdio_consumers[] = { + REGULATOR_SUPPLY("vsdio", NULL), +}; + +struct regulator_consumer_supply cpcap_vcsi_consumers[] = { + REGULATOR_SUPPLY("vcsi", NULL), +}; + +struct regulator_consumer_supply cpcap_vwlan1_consumers[] = { + REGULATOR_SUPPLY("vwlan1", NULL /* cpcap_cam_device */), +}; + +struct regulator_consumer_supply cpcap_vwlan2_consumers[] = { + REGULATOR_SUPPLY("vwlan2", NULL /* sd slot */), +}; + +struct regulator_consumer_supply cpcap_vsim_consumers[] = { + REGULATOR_SUPPLY("vsim", NULL), +}; + +struct regulator_consumer_supply cpcap_vsimcard_consumers[] = { + REGULATOR_SUPPLY("vsimcard", NULL), +}; + +struct regulator_consumer_supply cpcap_vvib_consumers[] = { + REGULATOR_SUPPLY("vvib", NULL /* vibrator */), +}; + +struct regulator_consumer_supply cpcap_vusb_consumers[] = { + REGULATOR_SUPPLY("vusb", NULL /* accy det */), +}; + +struct regulator_consumer_supply cpcap_vaudio_consumers[] = { + REGULATOR_SUPPLY("vaudio", NULL /* mic opamp */), +}; + +struct regulator_consumer_supply cpcap_vfuse_consumers[] = { + REGULATOR_SUPPLY("vfuse", NULL), +}; + +struct regulator_consumer_supply cpcap_vrf1_consumers[] = { + REGULATOR_SUPPLY("vrf1", NULL), +}; + + +static struct regulator_init_data cpcap_regulator[CPCAP_NUM_REGULATORS] = { + [CPCAP_SW4] = { + .constraints = { + .min_uV = 1000000, + .max_uV = 1000000, + .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | + REGULATOR_CHANGE_STATUS), + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_sw4_consumers), + .consumer_supplies = cpcap_sw4_consumers, + }, + [CPCAP_SW5] = { + .constraints = { + .min_uV = 5050000, + .max_uV = 5050000, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_sw5_consumers), + .consumer_supplies = cpcap_sw5_consumers, + }, + [CPCAP_VCAM] = { + .constraints = { + .min_uV = 2900000, + .max_uV = 2900000, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .apply_uV = 1, + + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vcam_consumers), + .consumer_supplies = cpcap_vcam_consumers, + }, + [CPCAP_VCSI] = { + .constraints = { + .min_uV = 1200000, + .max_uV = 1200000, + .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | + REGULATOR_CHANGE_STATUS), + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vcsi_consumers), + .consumer_supplies = cpcap_vcsi_consumers, + }, + [CPCAP_VDAC] = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .apply_uV = 1, + }, + }, + [CPCAP_VDIG] = { + .constraints = { + .min_uV = 1875000, + .max_uV = 1875000, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, + .apply_uV = 1, + }, + }, + [CPCAP_VFUSE] = { + .constraints = { + .min_uV = 1500000, + .max_uV = 3150000, + .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | + REGULATOR_CHANGE_STATUS), + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vfuse_consumers), + .consumer_supplies = cpcap_vfuse_consumers, + }, + [CPCAP_VHVIO] = { + .constraints = { + .min_uV = 2775000, + .max_uV = 2775000, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .always_on = 1, + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vhvio_consumers), + .consumer_supplies = cpcap_vhvio_consumers, + }, + [CPCAP_VSDIO] = { + .constraints = { + .min_uV = 2900000, + .max_uV = 2900000, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vsdio_consumers), + .consumer_supplies = cpcap_vsdio_consumers, + }, + [CPCAP_VPLL] = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .apply_uV = 1, + }, + }, + [CPCAP_VRF1] = { + .constraints = { + .min_uV = 2500000, + .max_uV = 2775000, + .valid_ops_mask = 0, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vrf1_consumers), + .consumer_supplies = cpcap_vrf1_consumers, + }, + [CPCAP_VRF2] = { + .constraints = { + .min_uV = 2775000, + .max_uV = 2775000, + .valid_ops_mask = 0, + }, + }, + [CPCAP_VRFREF] = { + .constraints = { + .min_uV = 2775000, + .max_uV = 2775000, + .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | + REGULATOR_CHANGE_STATUS), + .always_on = 1, + .apply_uV = 1, + }, + }, + [CPCAP_VWLAN1] = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | + REGULATOR_CHANGE_STATUS), + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vwlan1_consumers), + .consumer_supplies = cpcap_vwlan1_consumers, + }, + [CPCAP_VWLAN2] = { + .constraints = { + .min_uV = 3000000, + .max_uV = 3000000, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vwlan2_consumers), + .consumer_supplies = cpcap_vwlan2_consumers, + }, + [CPCAP_VSIM] = { + .constraints = { + .min_uV = 1800000, + .max_uV = 2900000, + .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | + REGULATOR_CHANGE_STATUS), + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vsim_consumers), + .consumer_supplies = cpcap_vsim_consumers, + }, + [CPCAP_VSIMCARD] = { + .constraints = { + .min_uV = 1800000, + .max_uV = 2900000, + .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | + REGULATOR_CHANGE_STATUS), + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vsimcard_consumers), + .consumer_supplies = cpcap_vsimcard_consumers, + }, + [CPCAP_VVIB] = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | + REGULATOR_CHANGE_STATUS), + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vvib_consumers), + .consumer_supplies = cpcap_vvib_consumers, + }, + [CPCAP_VUSB] = { + .constraints = { + .min_uV = 3300000, + .max_uV = 3300000, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vusb_consumers), + .consumer_supplies = cpcap_vusb_consumers, + }, + [CPCAP_VAUDIO] = { + .constraints = { + .min_uV = 2775000, + .max_uV = 2775000, + .valid_modes_mask = (REGULATOR_MODE_NORMAL | + REGULATOR_MODE_STANDBY), + .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | + REGULATOR_CHANGE_STATUS), + .apply_uV = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(cpcap_vaudio_consumers), + .consumer_supplies = cpcap_vaudio_consumers, + }, +}; + +static struct cpcap_adc_ato minnow_cpcap_adc_ato = { + .ato_in = 0x0480, + .atox_in = 0, + .adc_ps_factor_in = 0x0200, + .atox_ps_factor_in = 0, + .ato_out = 0, + .atox_out = 0, + .adc_ps_factor_out = 0, + .atox_ps_factor_out = 0, + .ichrg_sense_res = 220, +}; + +static struct cpcap_leds minnow_cpcap_leds = { + .display_led = { + .display_reg = CPCAP_REG_MDLC, + .display_mask = 0xFFFF, + .display_off = 0xFFFA, + .display_init = 0xB019, + .poll_intvl = 3000, + }, + .button_led = { + .button_reg = CPCAP_REG_BLUEC, + .button_mask = 0x03FF, + .button_on = 0x00F5, + .button_off = 0x00F4, + }, + .kpad_led = { + .kpad_reg = CPCAP_REG_KLC, + .kpad_mask = 0x7FFF, + .kpad_on = 0x5FF5, + .kpad_off = 0x5FF0, + }, + /* To find LUX value from ALS data, + below variables are used. + * lux_max - LUX maximum value + * lux_minimum - LUX minimum value + * als_max - Maximum ALS data + * als_min - Minimum ALS data */ + .als_data = { + .lux_max = 5115, + .lux_min = 0, + .als_max = 1023, + .als_min = 0, + }, +}; + +static struct cpcap_platform_data minnow_cpcap_data = { + .init = minnow_cpcap_spi_init, + .regulator_mode_values = cpcap_regulator_mode_values, + .regulator_off_mode_values = cpcap_regulator_off_mode_values, + .regulator_init = cpcap_regulator, + .adc_ato = &minnow_cpcap_adc_ato, + .leds = &minnow_cpcap_leds, + .ac_changed = NULL, + .batt_changed = NULL, + .usb_changed = NULL, + .is_umts = 0, + .hwcfg = {CPCAP_HWCFG0_NONE, CPCAP_HWCFG1_STBY_GPIO}, + .irq_gpio = CPCAP_GPIO, +}; + +static struct spi_board_info minnow_spi_board_info[] __initdata = { + /* CPCAP must be 1st object beacuse it is modified in spi_init() */ + { + .modalias = "cpcap", + .bus_num = 1, + .chip_select = 0, + .max_speed_hz = 3000000, + .controller_data = &minnow_cpcap_data, + .mode = SPI_CS_HIGH, + }, +}; + +void __init minnow_spi_init(void) +{ + int irq; + int ret; + int i; + + for (i = 0; i < CPCAP_REG_SIZE; i++) { + if (minnow_cpcap_spi_init[i].reg == CPCAP_REG_UNUSED) + break; + } + minnow_cpcap_data.init_len = i; + + ret = gpio_request(CPCAP_GPIO, "cpcap-irq"); + if (ret) + return; + ret = gpio_direction_input(CPCAP_GPIO); + if (ret) { + gpio_free(CPCAP_GPIO); + return; + } + + irq = gpio_to_irq(CPCAP_GPIO); + irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING); + minnow_spi_board_info[0].irq = irq; + + spi_register_board_info(minnow_spi_board_info, + ARRAY_SIZE(minnow_spi_board_info)); + + /* regulator_has_full_constraints(); */ +} 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); +} diff --git a/arch/arm/mach-omap2/board-minnow.c b/arch/arm/mach-omap2/board-minnow.c new file mode 100644 index 00000000000..ef21cfb8956 --- /dev/null +++ b/arch/arm/mach-omap2/board-minnow.c @@ -0,0 +1,69 @@ +/* + * linux/arch/arm/mach-omap2/board-minnow.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 <asm/mach/arch.h> +#include <asm/mach-types.h> + +#include <linux/of_irq.h> +#include <linux/of_platform.h> +#include <linux/input/touch_platform.h> +#include <linux/usb/musb.h> +#include <linux/usb/phy.h> +#include <linux/usb/nop-usb-xceiv.h> +#include "board-minnow.h" +#include "mux.h" +#include "common.h" +#include "dss-common.h" +#include "board-minnow.h" + +#include "sdram-toshiba-hynix-numonyx.h" + +static struct of_device_id omap_dt_match_table[] __initdata = { + { .compatible = "simple-bus", }, + { .compatible = "ti,omap-infra", }, + { } +}; + +static const char *omap3_gp_boards_compat[] __initdata = { + "mot,omap3-minnow", + NULL, +}; +static void __init minnow_musb_init(void) +{ + usb_bind_phy("musb-hdrc.1.auto", 0, "cpcap_usb"); + usb_musb_init(NULL); +} + +static void __init minnow_init(void) +{ + of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); + + omap_sdrc_init(JEDEC_JESD209A_sdrc_params, JEDEC_JESD209A_sdrc_params); + omap_minnow_display_init(); + minnow_spi_init(); + minnow_bt_init(); + minnow_sensors_init(); + minnow_cpcap_client_init(); + minnow_musb_init(); +} + +MACHINE_START(MINNOW, "minnow") + .atag_offset = 0x100, + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap3630_init_early, + .init_irq = omap_intc_of_init, + .handle_irq = omap3_intc_handle_irq, + .init_machine = minnow_init, + .init_late = omap3630_init_late, + .init_time = omap3_sync32k_timer_init, + .dt_compat = omap3_gp_boards_compat, + .restart = omap3xxx_restart, +MACHINE_END diff --git a/arch/arm/mach-omap2/board-minnow.h b/arch/arm/mach-omap2/board-minnow.h new file mode 100644 index 00000000000..9e5ede30395 --- /dev/null +++ b/arch/arm/mach-omap2/board-minnow.h @@ -0,0 +1,22 @@ +/* + * linux/arch/arm/mach-omap2/board-minnow.h + * + * 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/i2c.h> + +extern void __init minnow_bt_init(void); +extern void __init minnow_spi_init(void); +extern void __init minnow_sensors_init(void); +extern void __init minnow_touch_init(struct i2c_board_info *i2c_info); +extern void __init minnow_cpcap_client_init(void); + +#if defined(CONFIG_MFD_M4SENSORHUB) || defined(CONFIG_MFD_M4SENSORHUB_MODULE) +extern int m4sensorhub_stillmode_exit(void); +/* m4_ctrl == 0 OMAP and 1 Sensorhub */ +extern int m4sensorhub_set_display_control(int m4_ctrl, int gpio_mipi_mux); +#endif diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c index 393aeefaebb..d850864aa7f 100644 --- a/arch/arm/mach-omap2/dss-common.c +++ b/arch/arm/mach-omap2/dss-common.c @@ -249,3 +249,29 @@ void __init omap_4430sdp_display_init_of(void) omap_display_init(&sdp4430_dss_data); } + +static struct omap_dss_device minnow_panel_lcd_device = { + .name = "lcd", + .driver_name = "minnow-panel", + .type = OMAP_DISPLAY_TYPE_DSI, + .data = NULL, + .phy.dsi = { + .module = 0, + }, + .channel = OMAP_DSS_CHANNEL_LCD, +}; + +static struct omap_dss_device *minnow_panel_dss_devices[] = { + &minnow_panel_lcd_device, +}; + +static struct omap_dss_board_info minnow_panel_dss_data = { + .num_devices = ARRAY_SIZE(minnow_panel_dss_devices), + .devices = minnow_panel_dss_devices, + .default_device = &minnow_panel_lcd_device, +}; + +void __init omap_minnow_display_init(void) +{ + omap_display_init(&minnow_panel_dss_data); +} diff --git a/arch/arm/mach-omap2/dss-common.h b/arch/arm/mach-omap2/dss-common.h index 915f6fff510..c8d24f42f49 100644 --- a/arch/arm/mach-omap2/dss-common.h +++ b/arch/arm/mach-omap2/dss-common.h @@ -11,4 +11,6 @@ void __init omap4_panda_display_init_of(void); void __init omap_4430sdp_display_init(void); void __init omap_4430sdp_display_init_of(void); +void __init omap_minnow_display_init(void); + #endif diff --git a/arch/arm/mach-omap2/sdram-toshiba-hynix-numonyx.h b/arch/arm/mach-omap2/sdram-toshiba-hynix-numonyx.h new file mode 100644 index 00000000000..c7acdb8312d --- /dev/null +++ b/arch/arm/mach-omap2/sdram-toshiba-hynix-numonyx.h @@ -0,0 +1,66 @@ +/* + * SDRC register values for the Toshiba, Hynxi and Numonyx. + * These are common SDRC parameters for all vendors since we + * use the JEDEC JESD209A parameters. + * + * 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. + */ + +#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_TOSHIBA_HYNIX_NUMONYX + +#define ARCH_ARM_MACH_OMAP2_SDRAM_TOSHIBA_HYNIX_NUMONYX + +#include "sdrc.h" + +static struct omap_sdrc_params JEDEC_JESD209A_sdrc_params[] = { + [0] = { + .rate = 200000000, + .actim_ctrla = 0xE2E1B4C6, + .actim_ctrlb = 0x00022228, + .rfr_ctrl = 0x0005E602, + .mr = 0x00000032, + }, + [1] = { + .rate = 100000000, + .actim_ctrla = 0x7211B485, + .actim_ctrlb = 0x00022214, + .rfr_ctrl = 0x0002DA02, + .mr = 0x00000032, + }, + [2] = { + .rate = 166000000, + .actim_ctrla = 0xE2E1B4C6, + .actim_ctrlb = 0x00022228, + .rfr_ctrl = 0x0004DD02, + .mr = 0x00000032, + }, + [3] = { + .rate = 83000000, + .actim_ctrla = 0x7215B485, + .actim_ctrlb = 0x00022214, + .rfr_ctrl = 0x00025602, + .mr = 0x00000032, + }, + [4] = { + .rate = 160000000, + .actim_ctrla = 0xBA9DB4C6, + .actim_ctrlb = 0x00022220, + .rfr_ctrl = 0x0004AE02, + .mr = 0x00000032, + }, + [5] = { + .rate = 80000000, + .actim_ctrla = 0x49512284, + .actim_ctrlb = 0x0001120C, + .rfr_ctrl = 0x23E02, + .mr = 0x00000032, + }, + [6] = { + .rate = 0 + }, +}; + +#endif + |