diff options
| author | mattis fjallstrom <mattis@acm.org> | 2015-06-01 19:08:33 -0700 |
|---|---|---|
| committer | mattis fjallstrom <mattis@acm.org> | 2015-06-01 19:08:33 -0700 |
| commit | cf4422bbeffcf1e1a57dcb537a9a76056307ac43 (patch) | |
| tree | 4afa334251604e9ca537adbdac3e40d509c21d59 | |
| parent | 44db13a9f2f0a90723d7cfc26369199fd9f459ef (diff) | |
| download | olio-linux-3.10-cf4422bbeffcf1e1a57dcb537a9a76056307ac43.tar.xz olio-linux-3.10-cf4422bbeffcf1e1a57dcb537a9a76056307ac43.zip | |
Integrated changes that allows sleep, with all the drivers of a complete system. First stab at i2c support in device tree. Still crashes when sleeping.
Change-Id: I0354b3e26e16e0326ad82da8f049b7eee68d3a67
| -rw-r--r-- | arch/arm/boot/dts/omap3.dtsi | 11 | ||||
| -rw-r--r-- | arch/arm/boot/dts/omap3_h1.dts | 62 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3h1.c | 45 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/pm-debug.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/pm.h | 2 | ||||
| -rw-r--r-- | drivers/video/omap2/displays/panel-ili9342.c | 35 |
6 files changed, 120 insertions, 37 deletions
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 4ab826d64f6..a6e8ef88219 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi @@ -225,7 +225,7 @@ ti,hwmods = "uart3"; clock-frequency = <48000000>; }; -/* + /* i2c1: i2c@48070000 { compatible = "ti,omap3-i2c"; #address-cells = <1>; @@ -246,6 +246,7 @@ #size-cells = <0>; ti,hwmods = "i2c3"; }; + */ mcspi1: spi@48098000 { compatible = "ti,omap2-mcspi"; #address-cells = <1>; @@ -263,7 +264,7 @@ dma-names = "tx0", "rx0", "tx1", "rx1", "tx2", "rx2", "tx3", "rx3"; }; - + /* mcspi2: spi@4809a000 { compatible = "ti,omap2-mcspi"; #address-cells = <1>; @@ -299,8 +300,7 @@ dmas = <&sdma 70>, <&sdma 71>; dma-names = "tx0", "rx0"; }; -*/ - + */ mmc1: mmc@4809c000 { compatible = "ti,omap3-hsmmc"; ti,hwmods = "mmc1"; @@ -323,11 +323,12 @@ dma-names = "tx", "rx"; }; + /* NOTE: DON'T TAKE THIS OUT, messes everything up! (crash in omap_sram_idle) */ wdt2: wdt@48314000 { compatible = "ti,omap3-wdt"; ti,hwmods = "wd_timer2"; }; - + mcbsp1: mcbsp@48074000 { compatible = "ti,omap3-mcbsp"; reg = <0x48074000 0xff>; diff --git a/arch/arm/boot/dts/omap3_h1.dts b/arch/arm/boot/dts/omap3_h1.dts index 76f170126be..1d9be4e7bfe 100644 --- a/arch/arm/boot/dts/omap3_h1.dts +++ b/arch/arm/boot/dts/omap3_h1.dts @@ -118,9 +118,7 @@ 0x0f2 0x11c /* CAM_D6, MODE4 | INPUT_PULLUP */ 0x5ba 0x004 /* ETK_D7, MODE4 | OUTPUT */ - 0x1b0 0x100 /* SYS_NIRQ, MODE0 | INPUT */ - 0x0dc 0x004 /* CAM_HS, MODE4 | OUTPUT */ >; }; @@ -186,6 +184,64 @@ status = "disabled"; }; + +#if 0 +&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 { status = "disabled"; }; @@ -197,6 +253,6 @@ &uart3 { pinctrl-0 = <&uart3_pins>; pinctrl-names = "default"; - autosuspend-delay = <3000>; + autosuspend-delay = <(-1)>; /* -1 = infinity. Negative value needs parens */ wakeup-capable; }; diff --git a/arch/arm/mach-omap2/board-omap3h1.c b/arch/arm/mach-omap2/board-omap3h1.c index 610efcc5c71..465ead82f8f 100644 --- a/arch/arm/mach-omap2/board-omap3h1.c +++ b/arch/arm/mach-omap2/board-omap3h1.c @@ -171,9 +171,9 @@ static struct spi_board_info omap3h1_spi_board_info[] __initdata = { }; static int __init omap3h1_spi_init(void) { - spi_register_board_info(omap3h1_spi_board_info, - ARRAY_SIZE(omap3h1_spi_board_info)); - return 0; + spi_register_board_info(omap3h1_spi_board_info, + ARRAY_SIZE(omap3h1_spi_board_info)); + return 0; } @@ -559,24 +559,24 @@ static struct regulator_init_data tps65910_vdd1 = { .name = "vdd_mpu_iva", .min_uV = 900000, .max_uV = 1350000, - .valid_modes_mask = REGULATOR_MODE_NORMAL, - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, + .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 = { - .uV = 1, .mode = REGULATOR_MODE_STANDBY, - .disabled = 1, + .enabled = 1, + .disabled = 0, }, .state_disk = { - .uV = 1, .mode = REGULATOR_MODE_STANDBY, - .disabled = 1, + .enabled = 1, + .disabled = 0, }, .state_standby = { - .uV = 1, .mode = REGULATOR_MODE_STANDBY, - .disabled = 1, + .enabled = 1, + .disabled = 0, }, }, @@ -598,24 +598,24 @@ static struct regulator_init_data tps65910_vdd2 = { .name = "vdd_core", .min_uV = 900000, .max_uV = 1200000, - .valid_modes_mask = REGULATOR_MODE_NORMAL, - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, + .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 = { - .uV = 1, .mode = REGULATOR_MODE_STANDBY, - .disabled = 1, + .enabled = 1, + .disabled = 0, }, .state_disk = { - .uV = 1, .mode = REGULATOR_MODE_STANDBY, - .disabled = 1, + .enabled = 1, + .disabled = 0, }, .state_standby = { - .uV = 1, - .mode = REGULATOR_MODE_STANDBY, - .disabled = 1, + .mode = REGULATOR_MODE_STANDBY, + .enabled = 1, + .disabled = 0, }, }, @@ -1195,7 +1195,8 @@ static void __init omap3_h1_init(void) omap_sdrc_init(mt29c8g96_sdrc_params, mt29c8g96_sdrc_params); - omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); + /* This is done in our device tree file now */ + /* omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); */ omap3_h1_i2c_init(); @@ -1208,9 +1209,9 @@ static void __init omap3_h1_init(void) #if 0 omap_serial_board_init(omap_uart_ports); +#endif omap_display_init(&omap3h1_dss_data); -#endif usb_bind_phy("musb-hdrc.0.auto", 0, "nop_usb_xceiv"); /* "tusb-usb-h1" */ diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index ea5a306d1f1..94036241cec 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -45,7 +45,7 @@ u32 enable_off_mode; * global_disable_off_mode supercedes enable_off_mode and keeps * offmode disabled as long as it is set */ -bool global_disable_off_mode = 1; +bool global_disable_off_mode = 0; module_param(global_disable_off_mode, bool, 0644); #ifdef CONFIG_DEBUG_FS diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 551db0bb4a6..739ca80d004 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -56,7 +56,7 @@ extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); #ifdef CONFIG_PM_DEBUG extern u32 enable_off_mode; #else -#define enable_off_mode 0 +#define enable_off_mode 1 #endif #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) diff --git a/drivers/video/omap2/displays/panel-ili9342.c b/drivers/video/omap2/displays/panel-ili9342.c index 40a9713aa0d..c9890b8a653 100644 --- a/drivers/video/omap2/displays/panel-ili9342.c +++ b/drivers/video/omap2/displays/panel-ili9342.c @@ -1,4 +1,3 @@ -#define DEBUG /* * Driver for ili9342 display driver * @@ -32,6 +31,7 @@ #include <video/omapdss.h> #define OLIODEBUG + #ifdef OLIODEBUG #define oliodebug(...) printk ( __VA_ARGS__ ) #else @@ -147,6 +147,8 @@ static int ili9342_panel_probe(struct omap_dss_device *dssdev) dev_dbg(&dssdev->dev, "probe\n"); + printk ("OLIO %s entered\n", __FUNCTION__); + if (!dssdev || !dssdev->name) return -EINVAL; @@ -261,6 +263,7 @@ static int ili9342_get_recommended_bpp(struct omap_dss_device *dssdev) { return 24; } + /*************************************************************************** * suspend & resume * @@ -269,15 +272,26 @@ static int ili9342_get_recommended_bpp(struct omap_dss_device *dssdev) { */ static int ili9342_disp_suspend (struct device * dev) { - ili9342_panel_disable((struct omap_dss_device *) dev); + printk ("OLIO: %s Suspending display.\n", __FUNCTION__); + ili9342_panel_disable(to_dss_device(dev)); return 0; } static int ili9342_disp_resume (struct device * dev) { - ili9342_panel_enable((struct omap_dss_device *) dev); + printk ("OLIO: %s Resuming display.\n", __FUNCTION__); + ili9342_panel_enable(to_dss_device(dev)); return 0; } +#if defined(CONFIG_HAS_AMBIENTMODE) +static int ili9342_panel_disable_wrapper (struct omap_dss_device *display) { + printk ("OLIO: %s Suspending display.\n", __FUNCTION__); + ili9342_panel_disable(display); + return 0; +} +#endif + + static struct dev_pm_ops ili9342_disp_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(ili9342_disp_suspend, ili9342_disp_resume) }; @@ -296,6 +310,13 @@ static struct omap_dss_driver ili9342_driver = { .get_recommended_bpp = ili9342_get_recommended_bpp, +#if 0 +#if defined(CONFIG_HAS_AMBIENTMODE) + .resume = ili9342_panel_enable, + .suspend = ili9342_panel_disable_wrapper, +#endif +#endif + .driver = { .name = "ili9342_panel", .owner = THIS_MODULE, @@ -503,6 +524,8 @@ static int ili9342_spi_probe(struct spi_device *spi) spi_regulator = devm_regulator_get(&spi->dev, "vdd"); + printk ("OLIO %s entered\n", __FUNCTION__); + if (IS_ERR(spi_regulator)) { dev_err(&spi->dev, "regulator get failed\n"); err = PTR_ERR(spi_regulator); @@ -541,7 +564,7 @@ static int ili9342_suspend(struct device *dev) { ret); return ret; } - + return 0; } @@ -577,7 +600,9 @@ static int ili9342_resume(struct device *dev) { static struct dev_pm_ops ili9342_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(ili9342_suspend, ili9342_resume) + /* SET_SYSTEM_SLEEP_PM_OPS(ili9342_suspend, ili9342_resume) */ + .suspend_late = ili9342_suspend, + .resume_early = ili9342_resume, }; |