summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authormattis fjallstrom <mattis@acm.org>2015-07-23 17:15:27 -0700
committermattis fjallstrom <mattis@acm.org>2015-07-23 17:15:27 -0700
commit74d71e3bbccfdb208dd4385df5a636f889b3cd05 (patch)
tree1da3047144075bed53290b018a675d9686c4fb69 /arch
parent5d1c09eedec0cf5fd486d240b4ede1c476ed6adf (diff)
parentcd0f92406cc231fda66c30312f48d12fab5ac614 (diff)
downloadolio-linux-3.10-74d71e3bbccfdb208dd4385df5a636f889b3cd05.tar.xz
olio-linux-3.10-74d71e3bbccfdb208dd4385df5a636f889b3cd05.zip
Merged bluetooth and ST mods from mattis_bt_work.
Change-Id: Ic904469eae89e5678a502e78309b30ab9715cd41
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/omap3.dtsi10
-rw-r--r--arch/arm/boot/dts/omap3_h1.dts337
-rw-r--r--arch/arm/configs/omap3_h1_defconfig68
-rw-r--r--arch/arm/mach-omap2/Kconfig29
-rw-r--r--arch/arm/mach-omap2/board-omap3h1-bluetooth.c170
-rw-r--r--arch/arm/mach-omap2/board-omap3h1.c854
-rw-r--r--arch/arm/mach-omap2/opp.c2
-rw-r--r--arch/arm/mach-omap2/pm.c9
-rw-r--r--arch/arm/mach-omap2/pm34xx.c84
-rw-r--r--arch/arm/mach-omap2/serial.c1
10 files changed, 566 insertions, 998 deletions
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 78e97bea7af..cae4e9725d0 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -13,12 +13,13 @@
/ {
compatible = "ti,omap3430", "ti,omap3";
interrupt-parent = <&intc>;
-
+/*
aliases {
serial0 = &uart1;
serial1 = &uart2;
serial2 = &uart3;
};
+ */
cpus {
cpu@0 {
@@ -207,7 +208,7 @@
<&omap3_pmx_core 26 0xd9 1>,
<&omap3_pmx_core 28 0xc1 4>;
};
-
+/*
uart1: serial@4806a000 {
compatible = "ti,omap3-uart";
ti,hwmods = "uart1";
@@ -224,8 +225,8 @@
compatible = "ti,omap3-uart";
ti,hwmods = "uart3";
clock-frequency = <48000000>;
- };
- /*
+ }; */
+
i2c1: i2c@48070000 {
compatible = "ti,omap3-i2c";
#address-cells = <1>;
@@ -233,6 +234,7 @@
ti,hwmods = "i2c1";
};
+ /*
i2c2: i2c@48072000 {
compatible = "ti,omap3-i2c";
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/omap3_h1.dts b/arch/arm/boot/dts/omap3_h1.dts
index 2e69ef757ff..94f566db142 100644
--- a/arch/arm/boot/dts/omap3_h1.dts
+++ b/arch/arm/boot/dts/omap3_h1.dts
@@ -26,20 +26,43 @@
800000 1275000
/* 1000000 1337500 */
>;
+ cpu0-supply = <&omap_tps65910>;
/* OPP tolerance in percentage */
voltage-tolerance = <0>;
reset-voltage = <1275000>;
};
};
+ vbat: fixedregulator@0 {
+ compatible = "regulator-fixed";
+ regulator-name = "vbat";
+ regulator-min-microvolt = <3700000>;
+ regulator-max-microvolt = <3700000>;
+ regulator-boot-on;
+ };
+
+ omap_pimic {
+ omap_tps65910: omap_vdd1 {
+ compatible = "ti,omap-tps65910-vdd1";
+ ti,boot-voltage-micro-volts = <1275000>;
+ ti,vp = <&vp_mpu>;
+ };
+
+ omap_tps65910_vdd2: omap_vdd2 {
+ compatible = "ti,omap-tps65910-vdd2";
+ ti,boot-voltage-micro-volts = <1200000>;
+ ti,vp = <&vp_core>;
+ };
+ };
+
pad-wkup {
/* on omap, the irqs are calculated as follows:
* for the 96 intc IRQs
* irq = 16 + irq_offset (from TRM sec 12.3.2)
- * for a gpio IRQ (banks numbered 1 to 6
- * irq = 16 + 96 + (gpio_bank - 1) * 32
+ * for a gpio IRQ (banks numbered 1 to 6)
+ * irq = 16 + 96 + (gpio_bank - 1) * 32 + GPIO no.
*/
- compatible = "ti,pad-wkup";
+ compatible = "ti,pad-wkup";
/* Map the pad offset (off) to an interrupt (IRQ). */
/* if handle is 1, an irq will be generated based on */
@@ -52,8 +75,17 @@
/* listed below will be reported as the wakeup reason */
/* */
/* off IRQ handle */
- ti,pad_irq = <0x16e 90 1>, /* uart3 - serial rx */
- <0x9f6 143 1>; /* mpu6515 irq pin */
+ ti,pad_irq = <0x150 88 1>, /* uart1 - BT input */
+ <0x16e 90 0>, /* uart3 - serial rx */
+ <0x9f6 143 1>, /* mpu6515 irq pin - is this offset correct? */
+ <0x9f4 123 1>, /* BT host wake */
+ <0x1b0 23 1>; /* sys_nirq */
+ };
+
+ sound {
+ compatible = "olio,omap-soc-omap3h1";
+ olio,mcbsp = <&mcbsp3>;
+ olio,mic_enable = <&gpio5 18 0>;
};
};
@@ -76,7 +108,7 @@
sys_off_mode;
auto_off;
auto_retention;
- offmodesetup_time = <3500>;
+ offmodesetup_time = <6000>;
clksetup_time = <1000>;
};
@@ -84,6 +116,7 @@
pinctrl-names = "default";
pinctrl-0 = <
&board_pins
+ &dev_pins
>;
board_pins: pinmux_board_pins {
@@ -116,17 +149,17 @@
0x1a0 0x000 /* MCSPI1_CS1, MODE0 | OUTPUT */
/* CKE pin for memory */
- 0x232 0x000 /* SDRC_CKE0, MODE0 | OUTPUT */
- 0x234 0x000 /* SDRC_CKE1, MODE0 | OUTPUT */
+ 0x232 0x000 /* SDRC_CKE0, MODE0 | OUTPUT */
+ 0x234 0x000 /* SDRC_CKE1, MODE0 | OUTPUT */
/* touch reset */
0x0f2 0x11c /* CAM_D6, MODE4 | INPUT_PULLUP */
- 0x5ba 0x004 /* ETK_D7, MODE4 | OUTPUT */
- 0x1b0 0x100 /* SYS_NIRQ, MODE0 | INPUT */
+ 0x1b0 0xc100 /* SYS_NIRQ, MODE0 | INPUT | OFFWAKEUP */
+
0x0dc 0x004 /* CAM_HS, MODE4 | OUTPUT */
- /* USB */
+ /* USB */
0x172 0x100 /* HSUSB0_CLK, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT) */
0x174 0x000 /* HSUSB0_STP, (OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT) */
@@ -142,33 +175,52 @@
0x188 0x100 /* HSUSB0_DATA7, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT) */
/* pin for controlling bluetooth chip, settings from uboot */
+
+ 0x1a8 0x004 /* CONTROL_PADCONF_MCSPI2_SIMO, (IDIS | PI | M4 ) */
0x1aa 0x004 /* CONTROL_PADCONF_MCSPI2_SOMI, (IDIS | PI | M4 ) */
/* BT_WAKE_GPIO - for waking up BT */
- /* OMAP_OFF_ENABLE and OMAP_OFF_PULL_EN for sleep modes. */
- 0x0da 0x1204 /* DSS_DATA23, (IDIS | PI | M4 ) */
+ /* OMAP_OFF_ENABLE, OMAP_OFF_PULL_EN, OMAP_OFF_OUTENABLE for sleep modes. */
+ /* Now set this to regular old output */
+ 0x0da 0x004 /* 0x1604 */ /* DSS_DATA23, (IDIS | PI | M4 ) */
+ /* UART3 pins */
+ 0x16e 0x100 /* RX, input, off wake up */
+ 0x170 0x000 /* TX, output */
+
+ /* GPIO146, aka UART2TX, aka Microphone enable */
+ 0x148 0x161C /* (204) OUTPUT | GPIO | OFF_ENABLE | OFF_PULL_LOW */
+ /* (0x161C) 0001011000011100 | PULL_ENA | PULL_UP */
+
/* Accelerometer interrupt */
+ /* I've tried configuring this both in the wkup pinmux (below) and here,
+ but this location makes it not function as an interrupt... ??? */
/* 0x9f6 0x4104 */ /* JTAG_EMU1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT |
- OMAP_PIN_OFF_WAKEUPENABLE */
+ OMAP_PIN_OFF_WAKEUPENABLE */
+
+ 0x14c 0x000 /* UART1, BT, TX */
+ 0x14e 0x000 /* UART1, BT, RTS */
+ 0x150 0x4100 /* UART1, BT, CTS */
+ 0x152 0x100 /* UART1, BT, RX */
>;
};
- uart1_pins: pinmux_uart1_pins {
- pinctrl-single,pins = <
- /* uart1 */
- 0x152 0x118 /* UART1_RX, MODEO | (uboot: ien, pullup, m0 */
- 0x146 0x000 /* UART1_TX, MODE0 | OUTPUT, MODE0 */
- >;
- };
+ dev_pins: pinmux_pv_pins {
+ pinctrl-single,pins = <
+ 0x5b2 0x004 /* USB control, ETK_D3, MODE4 | OUTPUT */
+ /* 0x1a2 0x104 */ /* ALS interrupt, input, GPIO */
+ 0x086 0x004 /* DRV2605 vibrator, output, GPIO */
+ /* 0x938 0x104 */ /* Battery state, input, GPIO */
+ >;
+ };
- uart3_pins: pinmux_uart3_pins {
+ i2c1_pins: pinmux_i2c1_pins {
pinctrl-single,pins = <
- /* uart3 */
- 0x16e 0x4118 /* UART3_RX, MODEO | INPUT_PULLUP | OFFWAKEUP*/
- 0x170 0x000 /* UART3_TX, MODE0 | OUTPUT */
+ 0x18a 0x118 /* I2C1_SCL, MODE0 | INPUT_PULLUP */
+ 0x18c 0x118 /* I2C1_SCA, MODE0 | INPUT_PULLUP */
>;
};
+
};
@@ -177,26 +229,177 @@
pinctrl-names = "default";
pinctrl-0 = <&wkup_pins>;
- wkup_pins: pinmux_wakeup_pins {
+ wkup_pins: pinmux_wakeup_pins {
pinctrl-single,pins = <
0x006 0x008 /* SYS_CLKREQ, MODE0 | PULLDOWN */
0x018 0x000 /* SYS_OFF_MODE, MODE0 */
0x01a 0x10c /* SYS_CLKOUT1, MODE4 | INPUT_PULLDOWN */
- /* Bluetooth wakeup */
- /* 0x024 0x4104 */ /* JTAG_EMU0, OMAP_MUX_MODE4 | OMAP_PIN_INPUT |
+
+ /* Wakeup from Bluetooth */
+ 0x024 0x410C /* JTAG_EMU0, OMAP_MUX_MODE4 | OMAP_PIN_INPUT |
OMAP_PIN_OFF_WAKEUPENABLE */
/* Accelerometer interrupt */
- 0x026 0x4104 /* JTAG_EMU1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT |
+ 0x026 0x410C /* JTAG_EMU1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT |
OMAP_PIN_OFF_WAKEUPENABLE */
+
>;
};
};
+&i2c1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins>;
+
+ status = "okay";
+ clock-frequency = <400000>;
+
+ tps: tps@2d {
+ reg = <0x2d>;
+ };
+};
+
+/include/ "tps65910.dtsi"
+
+&tps {
+ interrupts = <7>; /* SYS_NIRQ */
+ interrupt-parent = <&intc>;
+
+ #interrupt-cells = <2>;
+ interrupt-controller;
+
+ ti,en-ck32k-xtal;
+ ti,en-dev-slp;
+ ti,sleepsig-pol;
+ ti,clkout32k-keepon;
+ /* set SR_CTL_I2C_SEL - access to smartreflex registers by control i2c */
+ ti,system-power-controller;
+
+ vcc1-supply = <&vbat>;
+ vcc2-supply = <&vbat>;
+ vcc3-supply = <&vbat>;
+ vcc4-supply = <&vbat>;
+ vcc5-supply = <&vbat>;
+ vcc6-supply = <&vbat>;
+ vcc7-supply = <&vbat>;
+ vccio-supply = <&vbat>;
+
+ regulators {
+ vrtc_reg: regulator@0 {
+ regulator-always-on;
+ ti,regulator-ext-sleep-control = <8>;
+ };
+
+ /* DSS is on this one */
+ vio_reg: regulator@1 {
+ regulator-name = "vdds_dsi";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ /* Leave one and two on for reliable wake-up */
+
+ vdd1_reg: regulator@2 {
+ /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
+ /*
+ regulator-boot-on;
+ regulator-always-on;
+ */
+ /* external sleep control by means of SYS_OFF_MODE signal */
+ regulator-name = "vdd_mpu_iva";
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <1350000>;
+ ti,regulator-ext-sleep-control = <8>;
+ };
+
+ vdd2_reg: regulator@3 {
+ /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
+ /*
+ regulator-boot-on;
+ regulator-always-on;
+ */
+ /* external sleep control by means of SYS_OFF_MODE signal */
+ regulator-name = "vdd_core";
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <1200000>;
+ ti,regulator-ext-sleep-control = <8>;
+ };
+
+ /* not used, I think */
+ vdd3_reg: regulator@4 {
+ status = "disabled";
+ ti,regulator-ext-sleep-control = <8>;
+ };
+
+ /* This is the accelerometer. We always want it on. */
+ vdig1_reg: regulator@5 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ /* vdig2_reg: regulator@6 {}; unused */
+ vdig2_reg: regulator@6 {
+ status = "disabled";
+ ti,regulator-ext-sleep-control = <8>;
+ };
+
+ /* Nobody is explicitly using this rail, but it seems like it goes to
+ * VDDA_DPLL_PER on the chip. So we need it.
+ */
+ vpll_reg: regulator@7 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ ti,regulator-ext-sleep-control = <8>;
+ };
+
+ /* vdac_reg: regulator@8 {}; unused */
+ vdac_reg: regulator@8 {
+ status = "disabled";
+ ti,regulator-ext-sleep-control = <8>;
+ };
+
+ vaux1_reg: regulator@9 { /* not used, 2.85V by default */
+ status = "disabled";
+ ti,regulator-ext-sleep-control = <8>;
+ };
+
+ vaux2_reg: regulator@10 {
+ regulator-name = "vaux2";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ ti,regulator-ext-sleep-control = <8>;
+ };
+
+ /* This is Bluetooth - never turn it off */
+
+ vaux33_reg: regulator@11 {
+ regulator-name = "vaux33";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ /* ti,regulator-ext-sleep-control = <8>; */
+ };
+
+ /* This one goes to both SPI (for DSS) and touch. How can I
+ * specify two consumers in DT? (vdd for dss, avdd for touch).
+ */
+ vmmc_reg: regulator@12 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ ti,regulator-ext-sleep-control = <8>;
+ };
+ };
+};
+
+
/* leave gpio bank interface clocks on during suspend
* to avoid race condition in gpio_irq_handler */
&gpio1 {
- ti,no_idle_on_suspend;
-};
+ ti,no_idle_on_suspend;
+ };
&gpio2 {
ti,no_idle_on_suspend;
@@ -232,75 +435,3 @@
};
-#if 0 /* Not currently used */
-&i2c1 {
- /* clock-frequency = <400000>; */
- /* PMIC ONLY */
-};
-
-
-/* I2C-2 has everything other than PMIC. */
-
-&i2c2 {
- clock-frequency = <400000>;
-
- mxt224@4a { /* Taken from Minnow, needs to be updated */
- compatible = "atmel,maxtouch"; /* OLIO */
- reg = <0x4a>; /* OLIO */
- interrupt-parent = <&gpio4>;
- interrupts = <3 0>; /* gpio-99 32 * 3 + 3 */
- wakeup-source;
- atmel,cfg-name = ""; /* needs setting, OLIO */
- atmel,reset_gpio = <>; /* needs setting, OLIO */
-
- /* below is from minnow */
-
- /* gpios = <&gpio4 3 0>, /\* IRQ gpio-099 *\/ */
- /* <&gpio6 4 0>; /\* RESET gpio-164*\/ */
-
- /* pinctrl-names = "pullup", "pulldown"; */
- /* pinctrl-0 = <&atmxt_int_pullup>; */
- /* pinctrl-1 = <&atmxt_int_pulldown>; */
- /* support-snowflake = <1>; */
- };
-
- mpu6515@68 {
- };
-
- /* This driver does not yet support device tree
- lm3530-led@38 {
- };*/
-
- /* This driver does not yet support device tree
- cm3391@10 {
- };*/
-
-
-
-};
-
-&i2c3 {
- clock-frequency = <400000>;
-
- /* This driver does not yet support device tree
- bq274xx@55 {
- }; */
-};
-
-#endif
-
-&uart1 {
- pinctrl-0 = <&uart1_pins>;
- pinctrl-names = "default";
-};
-
-&uart2 {
- status = "disabled";
-};
-
-&uart3 {
- pinctrl-0 = <&uart3_pins>;
- pinctrl-names = "default";
- autosuspend-delay = <(-1)>; /* -1 = infinity. Negative value needs parens */
- wakeup-capable;
-};
diff --git a/arch/arm/configs/omap3_h1_defconfig b/arch/arm/configs/omap3_h1_defconfig
index fd9226100e1..9b7c431d7b8 100644
--- a/arch/arm/configs/omap3_h1_defconfig
+++ b/arch/arm/configs/omap3_h1_defconfig
@@ -311,7 +311,10 @@ CONFIG_MACH_OMAP3_H1=y
# CONFIG_MACH_OMAP3_H1_EVT1 is not set
# CONFIG_MACH_OMAP3_H1_EVT2 is not set
# CONFIG_MACH_OMAP3_H1_DVT1 is not set
-CONFIG_MACH_OMAP3_H1_DVT2=y
+# CONFIG_MACH_OMAP3_H1_DVT2 is not set
+CONFIG_MACH_OMAP3_H1_PV=y
+# CONFIG_MACH_OMAP3_H1_PV1 is not set
+CONFIG_MACH_OMAP3_H1_PV2=y
# CONFIG_MACH_DEVKIT8000 is not set
# CONFIG_MACH_OMAP_LDP is not set
# CONFIG_MACH_OMAP3530_LV_SOM is not set
@@ -481,7 +484,7 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
-# CONFIG_GENERIC_CPUFREQ_CPU0 is not set
+CONFIG_GENERIC_CPUFREQ_CPU0=y
#
# ARM CPU frequency scaling drivers
@@ -531,7 +534,7 @@ CONFIG_WAKELOCK=y
CONFIG_PM_SLEEP=y
CONFIG_PM_AUTOSLEEP=y
CONFIG_PM_WAKELOCKS=y
-CONFIG_PM_WAKELOCKS_LIMIT=100
+CONFIG_PM_WAKELOCKS_LIMIT=1000
CONFIG_PM_WAKELOCKS_GC=y
CONFIG_PM_RUNTIME=y
CONFIG_PM=y
@@ -908,13 +911,37 @@ CONFIG_BQL=y
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
-# CONFIG_BT is not set
+CONFIG_BT=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+# CONFIG_BT_BNEP is not set
+# CONFIG_BT_HIDP is not set
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIBTUSB is not set
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+# CONFIG_BT_HCIUART_BCSP is not set
+# CONFIG_BT_HCIUART_ATH3K is not set
+# CONFIG_BT_HCIUART_LL is not set
+# CONFIG_BT_HCIUART_3WIRE is not set
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_BT_MRVL is not set
# CONFIG_AF_RXRPC is not set
CONFIG_FIB_RULES=y
# CONFIG_WIRELESS is not set
# CONFIG_WIMAX is not set
-# CONFIG_RFKILL is not set
+CONFIG_RFKILL=y
+CONFIG_RFKILL_PM=y
+# CONFIG_RFKILL_INPUT is not set
# CONFIG_RFKILL_REGULATOR is not set
+CONFIG_RFKILL_GPIO=y
+# CONFIG_RFKILL_WL18XX is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
@@ -1214,6 +1241,7 @@ CONFIG_SLHC=y
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_RTL8152 is not set
# CONFIG_USB_USBNET is not set
+# CONFIG_USB_HSO is not set
# CONFIG_USB_IPHETH is not set
# CONFIG_WLAN is not set
@@ -1254,7 +1282,7 @@ CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_KEYBOARD_GPIO=y
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
@@ -1774,7 +1802,7 @@ CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
CONFIG_OMAP2_DSS_RESET=y
CONFIG_FB_OMAP2=y
CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
-CONFIG_FB_OMAP2_NUM_FBS=3
+CONFIG_FB_OMAP2_NUM_FBS=2
#
# OMAP2/3 Display Device Drivers
@@ -1814,11 +1842,7 @@ CONFIG_SND_JACK=y
# CONFIG_SND_DRIVERS is not set
CONFIG_SND_ARM=y
CONFIG_SND_SPI=y
-CONFIG_SND_USB=y
-# CONFIG_SND_USB_AUDIO is not set
-# CONFIG_SND_USB_UA101 is not set
-# CONFIG_SND_USB_CAIAQ is not set
-# CONFIG_SND_USB_6FIRE is not set
+# CONFIG_SND_USB is not set
CONFIG_SND_SOC=y
CONFIG_SND_SOC_DMAENGINE_PCM=y
# CONFIG_SND_ATMEL_SOC is not set
@@ -2318,11 +2342,9 @@ CONFIG_STAGING=y
# Triggers - standalone
#
# CONFIG_IIO_PERIODIC_RTC_TRIGGER is not set
-CONFIG_IIO_GPIO_TRIGGER=y
-CONFIG_IIO_SYSFS_TRIGGER=y
-CONFIG_INV_MPU_IIO=y
-# CONFIG_INV_IIO_MPU3050_ACCEL_SLAVE_BMA250 is not set
-# CONFIG_DTS_INV_MPU_IIO is not set
+# CONFIG_IIO_GPIO_TRIGGER is not set
+# CONFIG_IIO_SYSFS_TRIGGER is not set
+# CONFIG_INV_MPU_IIO is not set
# CONFIG_IIO_SIMPLE_DUMMY is not set
# CONFIG_ZSMALLOC is not set
# CONFIG_BCM_WIMAX is not set
@@ -2394,6 +2416,7 @@ CONFIG_IIO=y
CONFIG_IIO_BUFFER=y
CONFIG_IIO_BUFFER_CB=y
CONFIG_IIO_KFIFO_BUF=y
+CONFIG_IIO_TRIGGERED_BUFFER=y
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
@@ -2468,6 +2491,17 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
# CONFIG_ITG3200 is not set
#
+# Inertial measurement units
+#
+# CONFIG_ADIS16400 is not set
+# CONFIG_ADIS16480 is not set
+# CONFIG_INV_MPU6050_IIO is not set
+CONFIG_ST_LSM6DS3_IIO=y
+CONFIG_ST_LSM6DS3_IIO_LIMIT_FIFO=0
+# CONFIG_ST_LSM6DS3_IIO_SENSORS_WAKEUP is not set
+# CONFIG_ST_LSM6DS3_IIO_MASTER_SUPPORT is not set
+
+#
# Light sensors
#
# CONFIG_ADJD_S311 is not set
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index c3fdbc0f08a..2793feafaae 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -216,7 +216,7 @@ config MACH_OMAP3_H1
choice
prompt "Olio H1B build version"
- default MACH_OMAP3_H1_EVT2
+ default MACH_OMAP3_H1_PV2
config MACH_OMAP3_H1_EVT1
bool "EVT1 Build of the H1 board"
@@ -231,9 +231,32 @@ config MACH_OMAP3_H1_DVT1
depends on MACH_OMAP3_H1
config MACH_OMAP3_H1_DVT2
- bool "DVT2 Build of the H1 board"
- depends on MACH_OMAP3_H1
+ bool "DVT2 Build of the H1 board"
+ depends on MACH_OMAP3_H1
+
+config MACH_OMAP3_H1_PV
+ bool "PV Build of the H1 board"
+ depends on MACH_OMAP3_H1
+endchoice
+
+choice
+ prompt "Olio H1B PV build version"
+
+config MACH_OMAP3_H1_PV1
+ bool "PV Board with Invensense accelerometer."
+ depends on MACH_OMAP3_H1_PV
+ help
+ This is our first PV board, with Invensense accelerometer. Hopefully
+ it'll be extinct soon. Don't forget to add the invensense driver to
+ the kernel as well.
+config MACH_OMAP3_H1_PV2
+ bool "PV Board with ST accelerometer."
+ depends on MACH_OMAP3_H1_PV
+ help
+ This is the better PV board, with a more capable accelerometer from ST.
+ Might be our last board! Don't forget to configure the accelerometer in
+ the kernel as well.
endchoice
config MACH_DEVKIT8000
diff --git a/arch/arm/mach-omap2/board-omap3h1-bluetooth.c b/arch/arm/mach-omap2/board-omap3h1-bluetooth.c
index 3cec4bee656..b3cb230e16b 100644
--- a/arch/arm/mach-omap2/board-omap3h1-bluetooth.c
+++ b/arch/arm/mach-omap2/board-omap3h1-bluetooth.c
@@ -36,25 +36,30 @@
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <asm/mach-types.h>
+#include <linux/platform_data/serial-omap.h>
#include "serial.h"
#include "board-omap3h1.h"
#include <linux/regulator/driver.h>
-static void update_host_wake_locked(int);
+static void set_host_wake_locked(int);
+#define BT_RESET_GPIO 179
#define BT_REG_GPIO 180
#define BT_WAKE_GPIO 93
#define BT_HOST_WAKE_GPIO 11
+#define UART_PORT 1
+
+#define olio_debug(format, ...) printk ("OLIO %s: ", __FUNCTION__); printk (format, ##__VA_ARGS__)
static struct rfkill *bt_rfkill;
static struct regulator *clk32ksys_reg;
static bool bt_enabled;
-static bool host_wake_uart_enabled;
-static bool wake_uart_enabled;
+static bool host_wake_uart_enabled = 0;
+static bool wake_uart_enabled = 0;
static struct dentry *btdebugdent;
-struct bcm_bt_lpm {
- int wake;
+static struct bcm_bt_lpm {
+ int bcm_wake;
int host_wake;
struct hrtimer enter_lpm_timer;
@@ -62,24 +67,36 @@ struct bcm_bt_lpm {
struct uart_port *uport;
- struct wake_lock wake_lock;
- char wake_lock_name[100];
+ /* Lock for use when host is communicating with chip */
+
+ struct wake_lock bcm_wake_lock;
+
+ /* Lock used when chip wakes up the host */
+
+ struct wake_lock host_wake_lock;
+
+ char host_wake_lock_name[100];
+ char bcm_wake_lock_name[100];
} bt_lpm;
static int bcm20702_bt_rfkill_set_power(void *data, bool blocked)
{
- // rfkill_ops callback. Turn transmitter on when blocked is false
+ // rfkill_ops callback. Turn transmitter on when blocked is false
if (!blocked) {
if (clk32ksys_reg && !bt_enabled)
regulator_enable(clk32ksys_reg);
+ gpio_set_value(BT_RESET_GPIO, 1);
gpio_set_value(BT_REG_GPIO, 1);
+ gpio_set_value(BT_RESET_GPIO, 1);
} else {
// Chip won't toggle host_wake after reset. Make sure
// we don't hold the wake_lock until chip wakes up again.
- update_host_wake_locked(0);
-
+ // set_host_wake_locked(0);
+ // OLIO removed, we'll let go of the wake lock when HOST_WAKE drops.
+
+ gpio_set_value(BT_RESET_GPIO, 0);
gpio_set_value(BT_REG_GPIO, 0);
if (clk32ksys_reg && bt_enabled)
regulator_disable(clk32ksys_reg);
@@ -96,20 +113,32 @@ static const struct rfkill_ops bcm20702_bt_rfkill_ops = {
static void set_wake_locked(int wake)
{
- bt_lpm.wake = wake;
+ if (bt_lpm.bcm_wake == wake) {
+ return;
+ }
- if (!wake)
- wake_unlock(&bt_lpm.wake_lock);
+ bt_lpm.bcm_wake = wake;
- //if (!wake_uart_enabled && wake)
- //omap_uart_enable(2);
+ if (wake) {
+ olio_debug ("Now locking wake lock\n");
+ wake_lock (&bt_lpm.bcm_wake_lock);
+ if (!wake_uart_enabled)
+ omap_serial_ext_uart_enable(UART_PORT);
+ }
gpio_set_value(BT_WAKE_GPIO, wake);
- //if (wake_uart_enabled && !wake)
- //omap_uart_disable(2);
+ /* Let UART know we're done with it */
+
+ if (wake_uart_enabled && !wake)
+ omap_serial_ext_uart_disable(UART_PORT);
wake_uart_enabled = wake;
+
+ if (!wake) {
+ olio_debug ("Now unlocking wake lock\n");
+ wake_unlock(&bt_lpm.bcm_wake_lock);
+ }
}
static enum hrtimer_restart enter_lpm(struct hrtimer *timer) {
@@ -122,41 +151,64 @@ static enum hrtimer_restart enter_lpm(struct hrtimer *timer) {
}
void bcm_bt_lpm_exit_lpm_locked(struct uart_port *uport) {
+ int ret;
+
bt_lpm.uport = uport;
- hrtimer_try_to_cancel(&bt_lpm.enter_lpm_timer);
+ ret = hrtimer_try_to_cancel(&bt_lpm.enter_lpm_timer);
+ if (ret == -1) {
+ olio_debug ("timer executing, unable to cancel\n");
+ }
+
set_wake_locked(1);
hrtimer_start(&bt_lpm.enter_lpm_timer, bt_lpm.enter_lpm_delay,
- HRTIMER_MODE_REL);
+ HRTIMER_MODE_REL);
}
EXPORT_SYMBOL(bcm_bt_lpm_exit_lpm_locked);
-static void update_host_wake_locked(int host_wake)
+static void set_host_wake_locked(int host_wake)
{
- if (host_wake == bt_lpm.host_wake)
+ olio_debug ("Entered, requested host_wake is %d\n", host_wake);
+
+ if (host_wake == bt_lpm.host_wake) {
+ olio_debug ("Host wake lock is already in requested state\n");
return;
+ }
+
+ olio_debug ("host_wake (%d) is different from bt_lpm.host_wake (%d)\n",
+ host_wake, bt_lpm.host_wake);
bt_lpm.host_wake = host_wake;
if (host_wake) {
- wake_lock(&bt_lpm.wake_lock);
+ olio_debug ("host_wake is set, taking wake lock\n");
+ wake_lock(&bt_lpm.host_wake_lock);
+
if (!host_wake_uart_enabled) {
- //omap_uart_enable(2);
+ omap_serial_ext_uart_enable(UART_PORT);
}
} else {
if (host_wake_uart_enabled) {
- //omap_uart_disable(2);
+ omap_serial_ext_uart_disable(UART_PORT);
}
- // Take a timed wakelock, so that upper layers can take it.
- // The chipset deasserts the hostwake lock, when there is no
- // more data to send.
- wake_lock_timeout(&bt_lpm.wake_lock, HZ/2);
+
}
+
+ /* Set wake lock to time out, so that upper layers can take it.
+ * The chipset deasserts the host wake lock when there is no
+ * more data to send.
+ */
+
+ if (!host_wake) {
+ olio_debug ("host_wake isn't set, adding timeout to wake lock\n");
+ wake_lock_timeout(&bt_lpm.host_wake_lock, HZ/2);
+ }
host_wake_uart_enabled = host_wake;
+ olio_debug ("Exiting\n");
}
static irqreturn_t host_wake_isr(int irq, void *dev)
@@ -165,7 +217,11 @@ static irqreturn_t host_wake_isr(int irq, void *dev)
unsigned long flags;
host_wake = gpio_get_value(BT_HOST_WAKE_GPIO);
- irq_set_irq_type(irq, host_wake ? IRQF_TRIGGER_LOW : IRQF_TRIGGER_HIGH);
+
+ /* Invert the interrupt type to catch the next transition */
+
+ irq_set_irq_type(irq, host_wake ? IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING);
+ olio_debug ("Set next trigger to be %s\n", host_wake ? "falling" : "rising");
if (!bt_lpm.uport) {
bt_lpm.host_wake = host_wake;
@@ -173,7 +229,7 @@ static irqreturn_t host_wake_isr(int irq, void *dev)
}
spin_lock_irqsave(&bt_lpm.uport->lock, flags);
- update_host_wake_locked(host_wake);
+ set_host_wake_locked(host_wake);
spin_unlock_irqrestore(&bt_lpm.uport->lock, flags);
return IRQ_HANDLED;
@@ -203,8 +259,8 @@ static int bcm_bt_lpm_init(struct platform_device *pdev)
bt_lpm.host_wake = 0;
irq = gpio_to_irq(BT_HOST_WAKE_GPIO);
- ret = request_irq(irq, host_wake_isr, IRQF_TRIGGER_HIGH,
- "bt host_wake", NULL);
+ ret = request_irq(irq, host_wake_isr, IRQF_TRIGGER_RISING,
+ "bt host_wake", NULL);
if (ret) {
gpio_free(BT_WAKE_GPIO);
gpio_free(BT_HOST_WAKE_GPIO);
@@ -221,10 +277,16 @@ static int bcm_bt_lpm_init(struct platform_device *pdev)
gpio_direction_output(BT_WAKE_GPIO, 0);
gpio_direction_input(BT_HOST_WAKE_GPIO);
- snprintf(bt_lpm.wake_lock_name, sizeof(bt_lpm.wake_lock_name),
- "BTLowPower");
- wake_lock_init(&bt_lpm.wake_lock, WAKE_LOCK_SUSPEND,
- bt_lpm.wake_lock_name);
+ snprintf(bt_lpm.bcm_wake_lock_name, sizeof(bt_lpm.bcm_wake_lock_name),
+ "BCM BTLowPower");
+ snprintf(bt_lpm.host_wake_lock_name, sizeof(bt_lpm.host_wake_lock_name),
+ "HOST BTLowPower");
+
+ wake_lock_init(&bt_lpm.bcm_wake_lock, WAKE_LOCK_SUSPEND,
+ bt_lpm.bcm_wake_lock_name);
+ wake_lock_init(&bt_lpm.host_wake_lock, WAKE_LOCK_SUSPEND,
+ bt_lpm.host_wake_lock_name);
+
return 0;
}
@@ -232,7 +294,7 @@ static int btdebug_dump(struct seq_file *sf, void *private)
{
seq_printf(sf, "en=%d bt_wake=%d lpm.w=%d w_uart_en=%d\n",
bt_enabled, gpio_get_value(BT_WAKE_GPIO),
- bt_lpm.wake, wake_uart_enabled);
+ bt_lpm.bcm_wake, wake_uart_enabled);
seq_printf(sf, "bt_host_wake=%d lpm.hw=%d hw_uart_en=%d\n",
gpio_get_value(BT_HOST_WAKE_GPIO), bt_lpm.host_wake,
host_wake_uart_enabled);
@@ -256,14 +318,15 @@ static int bcm20702_bluetooth_probe(struct platform_device *pdev)
int rc = 0;
int ret = 0;
-// rc = gpio_request(BT_RESET_GPIO, "bcm20702_nreset_gpip");
-// if (unlikely(rc)) {
-// return rc;
-// }
+ rc = gpio_request(BT_RESET_GPIO, "bcm20702_nreset_gpip");
+
+ if (unlikely(rc)) {
+ return rc;
+ }
rc = gpio_request(BT_REG_GPIO, "bcm20702_nshutdown_gpio");
if (unlikely(rc)) {
- //gpio_free(BT_RESET_GPIO);
+ gpio_free(BT_RESET_GPIO);
return rc;
}
@@ -274,14 +337,14 @@ static int bcm20702_bluetooth_probe(struct platform_device *pdev)
}
gpio_direction_output(BT_REG_GPIO, 1);
- //gpio_direction_output(BT_RESET_GPIO, 1);
+ gpio_direction_output(BT_RESET_GPIO, 1);
bt_rfkill = rfkill_alloc("bcm20702 Bluetooth", &pdev->dev,
RFKILL_TYPE_BLUETOOTH, &bcm20702_bt_rfkill_ops,
NULL);
if (unlikely(!bt_rfkill)) {
- //gpio_free(BT_RESET_GPIO);
+ gpio_free(BT_RESET_GPIO);
gpio_free(BT_REG_GPIO);
return -ENOMEM;
}
@@ -291,7 +354,7 @@ static int bcm20702_bluetooth_probe(struct platform_device *pdev)
if (unlikely(rc)) {
rfkill_destroy(bt_rfkill);
- //gpio_free(BT_RESET_GPIO);
+ gpio_free(BT_RESET_GPIO);
gpio_free(BT_REG_GPIO);
return -1;
}
@@ -301,7 +364,7 @@ static int bcm20702_bluetooth_probe(struct platform_device *pdev)
rfkill_unregister(bt_rfkill);
rfkill_destroy(bt_rfkill);
- //gpio_free(BT_RESET_GPIO);
+ gpio_free(BT_RESET_GPIO);
gpio_free(BT_REG_GPIO);
}
@@ -322,12 +385,13 @@ static int bcm20702_bluetooth_remove(struct platform_device *pdev)
debugfs_remove(btdebugdent);
gpio_free(BT_REG_GPIO);
- //gpio_free(BT_RESET_GPIO);
+ gpio_free(BT_RESET_GPIO);
gpio_free(BT_WAKE_GPIO);
gpio_free(BT_HOST_WAKE_GPIO);
regulator_put(clk32ksys_reg);
- wake_lock_destroy(&bt_lpm.wake_lock);
+ wake_lock_destroy(&bt_lpm.bcm_wake_lock);
+ wake_lock_destroy(&bt_lpm.host_wake_lock);
return 0;
}
@@ -337,7 +401,8 @@ int bcm4430_bluetooth_suspend(struct platform_device *pdev, pm_message_t state)
int host_wake;
disable_irq(irq);
- host_wake = gpio_get_value(BT_HOST_WAKE_GPIO); /* Never goes low - what's up? */
+
+ host_wake = gpio_get_value(BT_HOST_WAKE_GPIO);
if (host_wake) {
enable_irq(irq);
@@ -354,11 +419,14 @@ int bcm4430_bluetooth_resume(struct platform_device *pdev)
return 0;
}
+/*
+ .suspend = bcm4430_bluetooth_suspend,
+ .resume = bcm4430_bluetooth_resume,
+*/
+
static struct platform_driver bcm20702_bluetooth_platform_driver = {
.probe = bcm20702_bluetooth_probe,
.remove = bcm20702_bluetooth_remove,
- .suspend = bcm4430_bluetooth_suspend,
- .resume = bcm4430_bluetooth_resume,
.driver = {
.name = "bcm20702_bluetooth",
.owner = THIS_MODULE,
diff --git a/arch/arm/mach-omap2/board-omap3h1.c b/arch/arm/mach-omap2/board-omap3h1.c
index a3fc2d10bc8..145efe4da76 100644
--- a/arch/arm/mach-omap2/board-omap3h1.c
+++ b/arch/arm/mach-omap2/board-omap3h1.c
@@ -67,6 +67,8 @@
#include "board-flash.h"
#include "common-board-devices.h"
#include "board-omap3h1.h"
+#include "prm2xxx_3xxx.h"
+#include "prm-regbits-34xx.h"
#include "sdram-micron-mt29c8g96m-48.h"
@@ -76,24 +78,24 @@
#define ATMEL_MXT_GPIO 105
#define TPS_SYS_NIRQ 0
#define USB_IRQ 124
-#define USB_ON_ETK_D7 21
+#define USB_CS 17
#define DEFAULT_RXDMA_POLLRATE 1 /* RX DMA polling rate (us) */
#define DEFAULT_RXDMA_BUFSIZE 4096 /* RX DMA buffer size */
#define DEFAULT_RXDMA_TIMEOUT (3 * HZ)/* RX DMA timeout (jiffies) */
-#if defined(CONFIG_MACH_OMAP3_H1_DVT1) || defined(CONFIG_MACH_OMAP3_H1_DVT2)
+#if defined(CONFIG_MACH_OMAP3_H1_DVT1) || defined(CONFIG_MACH_OMAP3_H1_DVT2) || defined (CONFIG_MACH_OMAP3_H1_PV)
#define LCD_RESET_GPIO 94
#else
#define LCD_RESET_GPIO 122
#endif
-static struct accelerometer_wake {
- int awake;
- struct wake_lock lock;
- char lock_name[100];
- int user_pid;
-} acc_wake;
+static struct of_device_id omap_dt_match_table[] __initdata = {
+ { .compatible = "olio,omap3-h1", },
+ { .compatible = "simple-bus", },
+ { .compatible = "ti,omap-infra", },
+ { }
+};
static struct mtd_partition omap3h1_nand_partitions[] = {
/* All the partition sizes are listed in terms of NAND block size */
@@ -185,6 +187,7 @@ static int __init omap3h1_spi_init(void) {
* (0 means VLogic, which I'm not sure what it is).
*/
+#ifndef CONFIG_MACH_OMAP3_H1_PV2
static struct mpu_platform_data mpu_data = {
.int_config = 0x00,
.level_shifter = 1,
@@ -192,6 +195,7 @@ static struct mpu_platform_data mpu_data = {
-1, 0, 0,
0, 0, 1 },
};
+#endif
static struct lm3530_platform_data omap3h1_backlight_platform_data = {
.mode = LM3530_BL_MODE_MANUAL,
@@ -259,492 +263,6 @@ static struct platform_device nop_phy_device = {
/* }; */
-/* --------------------------------------------------------------------------- */
-/* REGULATOR - Fixed first
- */
-
-static struct regulator_init_data omap3h1_vbat_data = {
- .constraints.always_on = true,
- .constraints.valid_modes_mask = REGULATOR_MODE_NORMAL,
- .constraints.valid_ops_mask = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
-};
-
-static struct fixed_voltage_config omap3h1_vbat_pdata = {
- .supply_name = "VBAT",
- .microvolts = 3800000,
- .init_data = &omap3h1_vbat_data,
- .gpio = -EINVAL,
-};
-
-static struct platform_device omap3h1_vbat = {
- .name = "reg-fixed-voltage",
- .id = -1,
- .dev = {
- .platform_data = &omap3h1_vbat_pdata,
- },
-};
-
-
-/* --------------------------------------------------------------------------- */
-
-static struct regulator_init_data tps65910_dummy = {
- .supply_regulator = "VBAT",
- .constraints.always_on = false,
- .constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS,
-};
-
-/* --------------------------------------------------------------------------- */
-/* This one is required for the display to work.
- */
-
-static struct regulator_consumer_supply tps65910_touch3_supply[] = {
- REGULATOR_SUPPLY("avdd", "2-004a"),
- REGULATOR_SUPPLY("vdd", "spi1.1"),
-};
-
-static struct regulator_init_data tps65910_touch3 = {
- .supply_regulator = "VBAT",
- .constraints = {
- .min_uV = 3300000,
- .max_uV = 3300000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY,
- .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE,
- .always_on = false,
- .apply_uV = true,
-
- .state_mem = {
- .uV = 0,
- .mode = REGULATOR_MODE_STANDBY,
- .disabled = 1,
- },
- .state_disk = {
- .uV = 0,
- .mode = REGULATOR_MODE_STANDBY,
- .disabled = 1,
- },
- .state_standby = {
- .uV = 0,
- .mode = REGULATOR_MODE_STANDBY,
- .disabled = 1,
- },
- },
-
- .num_consumer_supplies = ARRAY_SIZE(tps65910_touch3_supply),
- .consumer_supplies = tps65910_touch3_supply,
-};
-
-/* --------------------------------------------------------------------------- */
-/* This regulator is for the vibrator. We currently lack a way of enabling /
- * disabling this since we lack a driver for the vibrator (we're just accessing
- * it's registers through the i2c bus).
- *
- * Hence, it's always on.
- */
-
-static struct regulator_consumer_supply tps65910_vibrator_supply[] = {
- REGULATOR_SUPPLY("vaux2", "drv2605"),
-};
-
-static struct regulator_init_data tps65910_vibrator = {
- .supply_regulator = "VBAT",
- .constraints = {
- .min_uV = 3300000,
- .max_uV = 3300000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY,
- .valid_ops_mask = REGULATOR_CHANGE_MODE,
- .always_on = false,
- .apply_uV = true,
-
- .state_mem = {
- .disabled = 1,
- },
- .state_disk = {
- .disabled = 1,
- },
- .state_standby = {
- .disabled = 1,
- },
- },
- .num_consumer_supplies = ARRAY_SIZE(tps65910_vibrator_supply),
- .consumer_supplies = tps65910_vibrator_supply,
-};
-
-
-
-/* --------------------------------------------------------------------------- */
-/* Seems like this one has to be on. It doesn't have any "official" consumers
- * ... but it's definitely needed. Bluetooth relies on it.
- */
-
-/*
-static struct regulator_consumer_supply tps65910_bluetooth_3v3[] = {
- REGULATOR_SUPPLY("clk32ksys", 0),
-};
-*/
-
-static struct regulator_init_data tps65910_3v3 = {
- .supply_regulator = "VBAT",
- .constraints = {
- .min_uV = 3300000,
- .max_uV = 3300000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY,
- .valid_ops_mask = REGULATOR_CHANGE_MODE |
- REGULATOR_CHANGE_STATUS,
- .always_on = false,
- .apply_uV = true,
-
- .state_mem = {
- .disabled = 1,
- },
- .state_disk = {
- .disabled = 1,
- },
- .state_standby = {
- .disabled = 1,
- },
- },
-
-};
-
-
-/* --------------------------------------------------------------------------- */
-/* This is the OMAP display subsystem. Part of the OMAP processor OCP stuff.
- * USB also depends on this, so if you want to transfer files it has to be
- * always on.
- * NAND flash and UART3 (which we don't use) requires it
- * as well. And the i2c bus, and lots of other stuff.
- *
- * Setting always_on to "false" resulted in almost no power savings, at
- * least in the current setting.
- */
-
-static struct regulator_consumer_supply tps65910_1v8_supply[] = {
- REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
-};
-
-static struct regulator_init_data tps65910_1v8 = {
- .supply_regulator = "VBAT",
- .constraints = {
- .min_uV = 1800000,
- .max_uV = 1800000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE | REGULATOR_MODE_STANDBY,
- .valid_ops_mask = REGULATOR_CHANGE_MODE,
- .always_on = true,
- .apply_uV = true,
- },
- .num_consumer_supplies = ARRAY_SIZE(tps65910_1v8_supply),
- .consumer_supplies = tps65910_1v8_supply,
-};
-
-/* --------------------------------------------------------------------------- */
-/* There's no driver explicitly using this one, but it goes to VDDA_DPLL_PER
- * on the OMAP chip. So it's used internally by the DPLL devices in PER, I think.
- */
-
-static struct regulator_consumer_supply tps65910_vpll_supply[] = {
-
-};
-
-static struct regulator_init_data tps65910_vpll = {
- .supply_regulator = "VBAT",
- .constraints = {
- .min_uV = 1800000,
- .max_uV = 1800000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY,
- .valid_ops_mask = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
- .always_on = true,
- .apply_uV = true,
- },
- .num_consumer_supplies = ARRAY_SIZE(tps65910_vpll_supply),
- .consumer_supplies = tps65910_vpll_supply,
-};
-
-
-/* --------------------------------------------------------------------------- */
-/* Touch power supply part 2.
- */
-
-static struct regulator_consumer_supply tps65910_touch_supply[] = {
- REGULATOR_SUPPLY("vdd", "2-004a" ),
-};
-
-static struct regulator_init_data tps65910_touch = {
- .supply_regulator = "VBAT",
- .constraints = {
- .min_uV = 1800000,
- .max_uV = 1800000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY,
- .valid_ops_mask = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
- .always_on = false,
- .apply_uV = true,
-
- .state_mem = {
- .uV = 1,
- .mode = REGULATOR_MODE_STANDBY,
- .disabled = 1,
- },
- .state_disk = {
- .uV = 1,
- .mode = REGULATOR_MODE_STANDBY,
- .disabled = 1,
- },
- .state_standby = {
- .uV = 1,
- .mode = REGULATOR_MODE_STANDBY,
- .disabled = 1,
- },
-
- },
- .num_consumer_supplies = ARRAY_SIZE(tps65910_touch_supply),
- .consumer_supplies = tps65910_touch_supply,
-};
-
-/* =========================================================================== */
-
-/* --------------------------------------------------------------------------- */
-
-/* This one only works if 'always_on' is set to true. Do I need to do something
- * special otherwise to turn it on? Maybe the driver doesn't enable it.
- *
- * The accelerometer driver isn't using regulators properly, hence this needs to
- * be always on.
- */
-
-static struct regulator_consumer_supply tps65910_accel_supply[] = {
- REGULATOR_SUPPLY("vdd", "mpu6515"),
-};
-
-static struct regulator_init_data tps65910_accel = {
- .supply_regulator = "VBAT",
- .constraints = {
- .min_uV = 1800000,
- .max_uV = 1800000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE | REGULATOR_MODE_STANDBY,
- .valid_ops_mask = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
- .always_on = true,
- .apply_uV = true,
-
- .state_mem = {
- .uV = 1,
- .mode = REGULATOR_MODE_STANDBY,
- .disabled = 1,
- },
- .state_disk = {
- .uV = 1,
- .mode = REGULATOR_MODE_STANDBY,
- .disabled = 1,
- },
- .state_standby = {
- .uV = 1,
- .mode = REGULATOR_MODE_STANDBY,
- .disabled = 1,
- },
- },
- .num_consumer_supplies = ARRAY_SIZE(tps65910_accel_supply),
- .consumer_supplies = tps65910_accel_supply,
-};
-
-/* --------------------------------------------------------------------------- */
-/* Supplies the MPU PD and friends.
- */
-
-static struct regulator_consumer_supply tps65910_vdd1_supply[] = {
- REGULATOR_SUPPLY("vcc", "cpu0"),
-};
-
-static struct regulator_init_data tps65910_vdd1 = {
- .supply_regulator = "VBAT",
- .constraints = {
- .name = "vdd_mpu_iva",
- .min_uV = 900000,
- .max_uV = 1350000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_FAST,
- .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
- .always_on = false,
-
- .state_mem = {
- .mode = REGULATOR_MODE_STANDBY,
- .enabled = 1,
- .disabled = 0,
- },
- .state_disk = {
- .mode = REGULATOR_MODE_STANDBY,
- .enabled = 1,
- .disabled = 0,
- },
- .state_standby = {
- .mode = REGULATOR_MODE_STANDBY,
- .enabled = 1,
- .disabled = 0,
- },
- },
-
- .num_consumer_supplies = ARRAY_SIZE(tps65910_vdd1_supply),
- .consumer_supplies = tps65910_vdd1_supply,
-};
-
-/* --------------------------------------------------------------------------- */
-/* I seem to need always on, but the TWL code gets by without it. So...
- */
-
-static struct regulator_consumer_supply tps65910_vdd2_supply[] = {
- REGULATOR_SUPPLY("vdd_core", "l3_main.0"),
-};
-
-static struct regulator_init_data tps65910_vdd2 = {
- .supply_regulator = "VBAT",
- .constraints = {
- .name = "vdd_core",
- .min_uV = 900000,
- .max_uV = 1200000,
- .valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_FAST,
- .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
- .always_on = false,
-
- .state_mem = {
- .mode = REGULATOR_MODE_STANDBY,
- .enabled = 1,
- .disabled = 0,
- },
- .state_disk = {
- .mode = REGULATOR_MODE_STANDBY,
- .enabled = 1,
- .disabled = 0,
- },
- .state_standby = {
- .mode = REGULATOR_MODE_STANDBY,
- .enabled = 1,
- .disabled = 0,
- },
- },
-
- .num_consumer_supplies = ARRAY_SIZE(tps65910_vdd2_supply),
- .consumer_supplies = tps65910_vdd2_supply,
-};
-
-/* --------------------------------------------------------------------------- */
-
-/* The clock has to be ON, probably because we're not enabling it properly. */
-/* If I set i2chs_keepon to 6, UBIfs fails to mount (!?). Again, probably
- * not enabling it properly.
- *
- * And even with therm set, the screen acts weird (looking really dark during
- * boot, touch not working when up).
- */
-
-/*
-static struct tps65910_sleep_keepon_data olio_slp_keepon = {
- .therm_keepon = 0,
- .clkout32k_keepon = 0,
- .i2chs_keepon = 1,
- };*/
-
-
-
-static struct tps65910_board omap3h1_tps65910_pdata = {
- /* .irq = 7 + OMAP_INTC_START, */ /* Getting this at runtime instead. */
- .en_ck32k_xtal = true,
- /* .en_dev_slp = true, */
-
- /* .slp_keepon = &olio_slp_keepon, */
-
- .tps65910_pmic_init_data[TPS65910_REG_VIO] = &tps65910_1v8,
- .tps65910_pmic_init_data[TPS65910_REG_VDD1] = &tps65910_vdd1,
- .tps65910_pmic_init_data[TPS65910_REG_VDD2] = &tps65910_vdd2,
- .tps65910_pmic_init_data[TPS65910_REG_VDIG1] = &tps65910_accel,
- .tps65910_pmic_init_data[TPS65910_REG_VDIG2] = &tps65910_touch,
- .tps65910_pmic_init_data[TPS65910_REG_VPLL] = &tps65910_vpll,
-
- .tps65910_pmic_init_data[TPS65910_REG_VMMC] = &tps65910_touch3,
- .tps65910_pmic_init_data[TPS65910_REG_VAUX2] = &tps65910_vibrator,
-
- /* This one is connected to BT ... maybe more? */
-
- .tps65910_pmic_init_data[TPS65910_REG_VAUX33] = &tps65910_3v3,
-
- /* not actually used */
-
- .tps65910_pmic_init_data[TPS65910_REG_VRTC] = &tps65910_dummy,
- .tps65910_pmic_init_data[TPS65910_REG_VDAC] = &tps65910_dummy,
- .tps65910_pmic_init_data[TPS65910_REG_VAUX1] = &tps65910_dummy, /* 2v85 */
- .tps65910_pmic_init_data[TPS65910_REG_VDD3] = &tps65910_dummy,
-
- .pm_off = true,
-};
-
-
-/* ====================================================================== */
-/* Voltage domain settings */
-
-
-#define OMAP3_SRI2C_SLAVE_ADDR 0x12
-#define OMAP3_VDD_MPU_SR_CONTROL_REG 0x00
-#define OMAP3_VDD_CORE_SR_CONTROL_REG 0x01
-#define OMAP3_VP_CONFIG_ERROROFFSET 0x00
-#define OMAP3_VP_VSTEPMIN_VSTEPMIN 0x1
-#define OMAP3_VP_VSTEPMAX_VSTEPMAX 0x04
-#define OMAP3_VP_VLIMITTO_TIMEOUT_US 200
-
-
-static unsigned long olio_vsel_to_uv(const u8 vsel)
-{
- return (((vsel * 125) + 6000)) * 100;
-}
-
-static u8 olio_uv_to_vsel(unsigned long uv)
-{
- return DIV_ROUND_UP(uv - 600000, 12500);
-}
-
-
-static struct omap_voltdm_pmic omap3_mpu_pmic = {
- .slew_rate = 12500,
- .step_size = 12500,
- .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET,
- .vp_vstepmin = OMAP3_VP_VSTEPMIN_VSTEPMIN,
- .vp_vstepmax = OMAP3_VP_VSTEPMAX_VSTEPMAX,
- .vddmin = 900000,
- .vddmax = 1350000,
- .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
- .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
- .volt_reg_addr = OMAP3_VDD_MPU_SR_CONTROL_REG,
- .i2c_high_speed = true,
- .vsel_to_uv = olio_vsel_to_uv,
- .uv_to_vsel = olio_uv_to_vsel,
-};
-
-static struct omap_voltdm_pmic omap3_core_pmic = {
- .slew_rate = 12500,
- .step_size = 12500,
- .vp_erroroffset = OMAP3_VP_CONFIG_ERROROFFSET,
- .vp_vstepmin = OMAP3_VP_VSTEPMIN_VSTEPMIN,
- .vp_vstepmax = OMAP3_VP_VSTEPMAX_VSTEPMAX,
- .vddmin = 900000,
- .vddmax = 1200000,
- .vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
- .i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
- .volt_reg_addr = OMAP3_VDD_CORE_SR_CONTROL_REG,
- .i2c_high_speed = true,
- .vsel_to_uv = olio_vsel_to_uv,
- .uv_to_vsel = olio_uv_to_vsel,
-};
-
-int __init omap3_voltdm_init(void)
-{
- struct voltagedomain *voltdm;
-
- if (!cpu_is_omap34xx())
- return -ENODEV;
-
- voltdm = voltdm_lookup("mpu_iva");
- omap_voltage_register_pmic(voltdm, &omap3_mpu_pmic);
-
- voltdm = voltdm_lookup("core");
- omap_voltage_register_pmic(voltdm, &omap3_core_pmic);
-
- return 0;
-}
-
/* ====================================================================== */
@@ -752,18 +270,18 @@ int __init omap3_voltdm_init(void)
static struct i2c_board_info __initdata omap3h1_i2c1_board_info[] = {
{
- I2C_BOARD_INFO("tps65910", 0x2d),
- .platform_data = &omap3h1_tps65910_pdata,
},
-#ifdef CONFIG_MACH_OMAP3_H1_DVT2
+#if defined (CONFIG_MACH_OMAP3_H1_DVT2) || defined (CONFIG_MACH_OMAP3_H1_PV)
};
static struct i2c_board_info __initdata omap3h1_i2c2_board_info[] = {
#endif
{
+#ifdef CONFIG_MACH_OMAP3_H1_PV2
+ I2C_BOARD_INFO("lsm6ds3", 0x6a),
+#else
I2C_BOARD_INFO("mpu6515", 0x68),
- // This is needed for the interrupt wake. IH_GPIO_BASE changed in 3.10
- // .irq = (IH_GPIO_BASE + MPUIRQ_GPIO),
.platform_data = &mpu_data,
+#endif
},
{
/* Backlight */
@@ -786,197 +304,6 @@ static struct i2c_board_info __initdata omap3h1_i2c3_board_info[] = {
},
};
-#ifdef ONLY_KEEPING_THIS_STUFF_FOR_NOSTALGIC_REASONS
-
-/* --------------------------------------------------------------------------- */
-/* Create debugfs entry
- *
- * We need to have this so that our wake-up thread can tell us it's PID.
- * That PID will then be used when waking the system up.
- */
-
-struct dentry * pidfile;
-
-#define SIG_OLIO_WAKE 44 // we choose 44 as our signal number (real-time signals are in the range of 33 to 64)
-
-static ssize_t write_pid(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- char mybuf[10];
- int pid = 0;
-
- /* read the value from user space */
-
- if(count > 10)
- return -EINVAL;
- if (copy_from_user(mybuf, buf, count) != 0) {
- /* nothing read?? */
- printk ("OLIO: write_pid: Error??\n");
- return 0;
- }
-
- sscanf(mybuf, "%d", &pid);
-
- printk("pid read = %d\n", pid);
-
- acc_wake.user_pid = pid;
-
- return count;
-}
-
-static ssize_t send_wake_signal (void) {
- int ret;
- struct siginfo info;
- struct task_struct *t;
-
- /* send the signal */
-
- printk ("Now sending signal!\n");
-
- memset(&info, 0, sizeof(struct siginfo));
-
- /* this is bit of a trickery: SI_QUEUE is normally used by sigqueue from user space,
- * and kernel space should use SI_KERNEL. But if SI_KERNEL is used the real_time data
- * is not delivered to the user space signal handler function.
- */
-
- info.si_signo = SIG_OLIO_WAKE;
- info.si_code = SI_QUEUE;
-
- /* real time signals may have 32 bits of data. */
-
- info.si_int = 1234;
-
- rcu_read_lock();
-
- t = pid_task(find_pid_ns(acc_wake.user_pid, &init_pid_ns), PIDTYPE_PID);
-
- if(t == NULL){
- rcu_read_unlock();
- printk("no such pid\n");
- return -ENODEV;
- }
-
- rcu_read_unlock();
-
- /* send the signal */
-
- ret = send_sig_info(SIG_OLIO_WAKE, &info, t);
-
- if (ret < 0) {
- printk("error sending signal\n");
- }
- return ret;
-}
-
-static const struct file_operations h1_fops = {
- .write = write_pid,
-};
-
-
-/***************************************************************************
- * acc_irq_handler - handle interrupt from accelerometer
- *
- * This routine gets called when an interrupt from the accelerometer
- * happens. Time out is in milliseconds.
- *
- * TODO: BREAK this all out, place it in it's own kernel driver together
- * with the configuration stuff for the accelerometer (the low power sleep
- * mode stuff).
- */
-
-#define OLIO_DOUBLE_TAP 500
-#define OLIO_ONE_SECOND 1000
-#define OLIO_DT_WAIT 3000
-
-static unsigned long previous;
-static unsigned long previous_double;
-
-static irqreturn_t acc_irq_handler_thr(int irq, void * omap3h1_d) {
- /* struct platform_device** omap3h1_devs = (struct platform_device **) omap3h1_d; */
-
- int ret = 99;
- unsigned long now;
-
- printk (KERN_DEBUG "acc_irq_handler_thr: Entered!\n");
-
- now = jiffies;
-
- if (jiffies_to_msecs(now - previous) < OLIO_DOUBLE_TAP) {
-
- /* ignore double clicks that happens too soon from the previous one -
- * filters out inadvertent wake-ups
- */
-
- if (jiffies_to_msecs (now - previous_double) < OLIO_DT_WAIT)
- {
- previous = 0;
- return IRQ_HANDLED;
- }
-
- printk (KERN_DEBUG "Double tap detected!\n");
-
- /* We want to wake up. Take wake lock (and send signal to user space?)
- * BT driver only takes wake lock, then lets higher levels handle
- * everything ... but what if there's nothing there to take the lock?
- */
-
- send_wake_signal();
-
- wake_lock_timeout (&acc_wake.lock, msecs_to_jiffies (20 * OLIO_ONE_SECOND));
-
- previous_double = now;
- previous = 0;
- } else {
- previous = now;
- }
-
- printk (KERN_DEBUG "acc_irq_handler_thr: Leaving! (ret = %d)\n", ret);
-
- return IRQ_HANDLED;
-}
-
-static irqreturn_t acc_irq_handler(int irq, void * omap3h1_d) {
- printk (KERN_DEBUG "acc_irq_handler: Entered!\n");
-
- /* nothing to do, other than wake the main thread */
-
- printk (KERN_DEBUG "acc_irq_handler: Leaving!\n");
- return IRQ_WAKE_THREAD;
-}
-
-static int __init omap3_acc_irq_init (int irq, void * dev_id) {
- irq_set_irq_wake(irq, 1);
-
- if (request_threaded_irq (irq, acc_irq_handler,
- acc_irq_handler_thr,
- IRQF_SHARED | IRQF_TRIGGER_RISING,
- "acc_wake",
- dev_id)) {
- printk (KERN_DEBUG "Couldn't register handler for accelerometer IRQ\n");
- }
-
- /* Should check the return value ... but if it fails, what do we do? */
-
- return 0;
-}
-
-static int __init omap3_wake_init (void) {
- pidfile = debugfs_create_file("wake_signal_pid", 0200, NULL, NULL, &h1_fops);
- acc_wake.user_pid = 0; /* No user thread yet */
-
- snprintf(acc_wake.lock_name, sizeof(acc_wake.lock_name),
- "Accelerometer");
- wake_lock_init(&acc_wake.lock, WAKE_LOCK_SUSPEND,
- acc_wake.lock_name);
- return 0;
-}
-
-
-#endif /* ONLY_KEEPING_THIS_STUFF_FOR_NOSTALGIC_REASONS */
-
/***************************************************************************
* omap_uart data
@@ -1009,15 +336,18 @@ static struct omap_uart_port_info omap_uart_ports[] = {
.dma_rx_buf_size = DEFAULT_RXDMA_BUFSIZE,
.dma_rx_timeout = DEFAULT_RXDMA_TIMEOUT,
.dma_rx_poll_rate = DEFAULT_RXDMA_POLLRATE,
- .autosuspend_timeout = 5000,
- .wakeup_capable = false,
+ .autosuspend_timeout = 1000,
+ .wakelock_timeout = 150,
+ .wake_peer = bcm_bt_lpm_exit_lpm_locked,
+ .wakeup_capable = true,
+ .rx_trig = 0x3,
},
{
.dma_enabled = false, /* To specify DMA Mode */
.dma_rx_buf_size = DEFAULT_RXDMA_BUFSIZE,
.dma_rx_timeout = DEFAULT_RXDMA_TIMEOUT,
.dma_rx_poll_rate = DEFAULT_RXDMA_POLLRATE,
- .autosuspend_timeout = 5000,
+ .autosuspend_timeout = 0,
.wakeup_capable = false,
},
{
@@ -1033,28 +363,13 @@ static struct omap_uart_port_info omap_uart_ports[] = {
.dma_rx_buf_size = DEFAULT_RXDMA_BUFSIZE,
.dma_rx_timeout = DEFAULT_RXDMA_TIMEOUT,
.dma_rx_poll_rate = DEFAULT_RXDMA_POLLRATE,
- .autosuspend_timeout = 5000,
+ .autosuspend_timeout = 0,
.wakeup_capable = false,
},
};
/***************************************************************************
- * DEVICE TREE STUFF
- *
- * Trying to include some DT stuff with our board file. Not sure how this
- * will work out...
- */
-
-static struct of_device_id omap_dt_match_table[] __initdata = {
- { .compatible = "olio,omap3-h1", },
- { .compatible = "simple-bus", },
- { .compatible = "ti,omap-infra", },
- { }
-};
-
-
-/***************************************************************************
* omap3_h1_i2c_init - init the i2c buses
*
*/
@@ -1069,27 +384,24 @@ static int __init omap3_h1_i2c_init(void)
*/
gpio_request_one(ATMEL_MXT_GPIO, GPIOF_IN, "atmel_mxt_ts CHG");
- gpio_request_one(MPUIRQ_GPIO, GPIOF_IN, "mpu6515 IRQ pin");
+ gpio_request_one(MPUIRQ_GPIO, GPIOF_IN, "Accl IRQ pin");
acc_irq = gpio_to_irq(MPUIRQ_GPIO);
-#ifdef CONFIG_MACH_OMAP3_H1_DVT2
+#if defined (CONFIG_MACH_OMAP3_H1_DVT2) || defined (CONFIG_MACH_OMAP3_H1_PV)
omap3h1_i2c2_board_info[2].irq = gpio_to_irq(ATMEL_MXT_GPIO);
omap3h1_i2c2_board_info[0].irq = acc_irq;
-
- ((struct tps65910_board *) (omap3h1_i2c1_board_info[0].platform_data))->irq =
- gpio_to_irq (TPS_SYS_NIRQ);
#else
omap3h1_i2c1_board_info[3].irq = gpio_to_irq(ATMEL_MXT_GPIO);
omap3h1_i2c1_board_info[1].irq = acc_irq;
#endif
- gpio_request_one(USB_ON_ETK_D7, GPIOF_OUT_INIT_HIGH, "USB on");
+ gpio_request_one(USB_CS, GPIOF_OUT_INIT_HIGH, "USB on");
/* Register buses */
- omap_register_i2c_bus(1, 400, omap3h1_i2c1_board_info, ARRAY_SIZE(omap3h1_i2c1_board_info));
-#ifdef CONFIG_MACH_OMAP3_H1_DVT2
+ // omap_register_i2c_bus(1, 400, omap3h1_i2c1_board_info, ARRAY_SIZE(omap3h1_i2c1_board_info));
+#if defined (CONFIG_MACH_OMAP3_H1_DVT2) || defined (CONFIG_MACH_OMAP3_H1_PV)
omap_register_i2c_bus(2, 400, omap3h1_i2c2_board_info, ARRAY_SIZE(omap3h1_i2c2_board_info));
#else
omap_register_i2c_bus(2, 400, NULL, 0);
@@ -1104,132 +416,44 @@ static int __init omap3_h1_i2c_init(void)
static struct platform_device *omap3h1_devices[] __initdata = {
- &omap3h1_vbat,
&bcm20702_bluetooth_device,
&nop_phy_device,
&omap3h1_dmic_codec,
};
-
-#ifdef CONFIG_OMAP_MUX
-static struct omap_board_mux board_mux[] __initdata = {
-
-#if defined(CONFIG_MACH_OMAP3_H1_DVT1) || defined(CONFIG_MACH_OMAP3_H1_DVT2)
- OMAP3_MUX(CAM_HS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
-#else
- OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
-#endif
- OMAP3_MUX(DSS_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_HSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_VSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA8, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA9, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA10, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA11, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA12, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA13, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA14, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA15, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-
- OMAP3_MUX(MCSPI1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
- OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
- OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-
- /* TOUCH_RESET */
-
- OMAP3_MUX(CAM_D6, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
-
-#if defined(CONFIG_MACH_OMAP3_H1_DVT1) || defined(CONFIG_MACH_OMAP3_H1_DVT2)
- /* USB pin settings (mUSB) */
-
- OMAP3_MUX(HSUSB0_CLK, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_DATA0, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_DATA1, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_DATA2, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_DATA3, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_DATA4, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_DATA5, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_DATA6, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_DATA7, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_DIR, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_NXT, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
- OMAP3_MUX(HSUSB0_STP, (OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT)),
-#endif /* CONFIG_MACH_OMAP3_H1_DVT */
-
- /* accelerometer */
-
- OMAP3_MUX(JTAG_EMU1, (OMAP_MUX_MODE4 | OMAP_PIN_INPUT
- | OMAP_PIN_OFF_WAKEUPENABLE)),
-
- /* USB on */
-
- OMAP3_MUX(ETK_D7, (OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT)),
-
- OMAP3_MUX(SYS_NIRQ, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)),
-
- { .reg_offset = OMAP_MUX_TERMINATOR },
-};
-#endif
-
static void __init omap3_h1_init(void)
{
/* Read what we can from the device tree */
of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
+#ifdef CONFIG_MACH_OMAP3_H1_PV
+ /* The PV units need reversed polarity for the sysclkreq pin. */
+
+ omap2_prm_rmw_mod_reg_bits(OMAP3430_CLKREQ_POL_MASK,
+ 0, OMAP3430_GR_MOD,
+ OMAP3_PRM_POLCTRL_OFFSET);
+#endif
+
board_nand_init(omap3h1_nand_partitions,
ARRAY_SIZE(omap3h1_nand_partitions), NAND_CS,
NAND_BUSWIDTH_16, NULL);
omap_sdrc_init(mt29c8g96_sdrc_params, mt29c8g96_sdrc_params);
-
- /* This is done in our device tree file now */
- /* omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); */
-
- omap3_h1_i2c_init();
-
- /* Set up the voltage domains */
- omap3_voltdm_init();
+
+ omap3_h1_i2c_init();
platform_add_devices(omap3h1_devices, ARRAY_SIZE(omap3h1_devices));
omap3h1_spi_init();
-#if 0
omap_serial_board_init(omap_uart_ports);
-#endif
omap_display_init(&omap3h1_dss_data);
usb_bind_phy("musb-hdrc.0.auto", 0, "nop_usb_xceiv"); /* "tusb-usb-h1" */
usb_musb_init(&musb_board_data);
-
-#ifdef ONLY_KEEPING_THIS_STUFF_FOR_NOSTALGIC_REASONS
-
- /* For handling interrupts from the accelerometer */
-
- previous = jiffies;
-
- /* Init the code that handles wake ups */
-
- omap3_wake_init();
-
- omap3_acc_irq_init(omap3h1_i2c2_board_info[0].irq, (void *) &omap3h1_devices);
-
-#endif /* ONLY_KEEPING_THIS_STUFF_FOR_NOSTALGIC_REASONS */
-
}
static const char *omap3_h1_boards_compat[] __initdata = {
diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c
index 7149f838be4..82fd8c72f75 100644
--- a/arch/arm/mach-omap2/opp.c
+++ b/arch/arm/mach-omap2/opp.c
@@ -41,10 +41,8 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def,
{
int i, r;
- /* OLIO HACK
if (of_have_populated_dt())
return -EINVAL;
- */
if (!opp_def || !opp_def_size) {
pr_err("%s: invalid params!\n", __func__);
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index b2dc18a6b82..b06b22c3f64 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -276,8 +276,6 @@ static inline void omap_init_cpufreq(void)
devinfo.name = "omap-cpufreq";
else
devinfo.name = "cpufreq-cpu0";
-
- devinfo.name = "omap-cpufreq"; /* OLIO HACK */
platform_device_register_full(&devinfo);
}
@@ -311,6 +309,13 @@ int __init omap2_common_pm_late_init(void)
/* Smartreflex device init */
omap_devinit_smartreflex();
+ } else {
+ struct device_node *np;
+ np = of_find_node_by_name(NULL, "omap_pimic");
+ if (np) {
+ of_platform_populate(np, NULL, NULL, NULL);
+ of_node_put(np);
+ }
}
/* cpufreq dummy device instantiation */
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index bdb2388ef4c..ebe383ded55 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -281,6 +281,86 @@ static int omap34xx_do_sram_idle(unsigned long save_state)
return 0;
}
+static u32 wkup_debug_get_reg(phys_addr_t reg)
+{
+ u32 val;
+ char *baseptr = ioremap(reg, 4);
+
+ val = *(u32 *)baseptr;
+ iounmap(baseptr);
+
+ return val;
+}
+
+struct wkup_debug_t {
+ char name[20];
+ u32 reg;
+};
+
+struct wkup_debug_t wkup_debug_map[] = {
+ {
+ .reg = 0x4831001C,
+ .name = "GPIO_IRQENABLE1",
+ },
+ {
+ .reg = 0x48310020,
+ .name = "GPIO_WAKEUPENABLE",
+ },
+ {
+ .reg = 0x48310010,
+ .name = "GPIO_SYSCONFIG",
+ },
+ {
+ .reg = 0x48310064,
+ .name = "GPIO_SETIRQENABLE1",
+ },
+ {
+ .reg = 0x48310084,
+ .name = "GPIO_SETWKUENA",
+ },
+ {
+ .reg = 0x48310048,
+ .name = "GPIO_RISINGDETECT",
+ },
+ {
+ .reg = 0x4831004C,
+ .name = "GPIO_FALLINGDETECT",
+ },
+ {
+ .reg = 0x4830681C,
+ .name = "PRM_IRQENABLE_MPU",
+ },
+ {
+ .reg = 0x483069C8,
+ .name = "PM_WKDEP_MPU",
+ },
+ {
+ .reg = 0x48306CA4,
+ .name = "PM_MPUGRPSEL_WKUP",
+ },
+ {
+ .reg = 0x48306CA0,
+ .name = "PM_WKEN_WKUP",
+ },
+ {
+ .reg = 0x48306CB0,
+ .name = "PM_WKST_WKUP",
+ },
+};
+
+static void wkup_debug_print_regs(void)
+{
+ int i;
+ u32 val;
+ struct wkup_debug_t *p = wkup_debug_map;
+
+ for (i = 0; i < ARRAY_SIZE(wkup_debug_map); i++) {
+ val = wkup_debug_get_reg(p->reg);
+ trace_printk("%s, 0x%x, val: 0x%x\n", p->name, p->reg, val);
+ p++;
+ }
+}
+
void omap_sram_idle(bool in_suspend)
{
/* Variable to tell what needs to be saved and restored
@@ -360,8 +440,10 @@ void omap_sram_idle(bool in_suspend)
core_next_state == PWRDM_POWER_OFF)
sdrc_pwr = sdrc_read_reg(SDRC_POWER);
- if (suspend_debug)
+ if (suspend_debug) {
pm_dbg_regs_save(1);
+ wkup_debug_print_regs();
+ }
/*
* omap3_arm_context is the location where some ARM context
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index b570d93cbb7..b1f3fb1d396 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -301,6 +301,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
omap_up.dma_rx_timeout = info->dma_rx_timeout;
omap_up.dma_rx_poll_rate = info->dma_rx_poll_rate;
omap_up.autosuspend_timeout = info->autosuspend_timeout;
+ omap_up.wake_peer = info->wake_peer;
omap_up.DTR_gpio = info->DTR_gpio;
omap_up.DTR_inverted = info->DTR_inverted;
omap_up.DTR_present = info->DTR_present;