[PATCH v2] ARM: dts: sbc-t3x: add DVI display data

2014-11-02 Thread Dmitry Lifshitz
Add DSS related pinmux and display data nodes required to support
DVI video out on SBC-T3530, SBC-T3730 and SBC-T3517.

Signed-off-by: Dmitry Lifshitz lifsh...@compulab.co.il
---
v2:  * Make use of OMAP3_WKUP_IOPAD() macro
 * Move common DSS pinmux of CM-T3517 and CM-T3530
   into omap3-cm-t3x.dtsi.

 arch/arm/boot/dts/omap3-cm-t3517.dts  |   11 +++
 arch/arm/boot/dts/omap3-cm-t3530.dts  |   11 +++
 arch/arm/boot/dts/omap3-cm-t3730.dts  |   24 
 arch/arm/boot/dts/omap3-cm-t3x.dtsi   |   39 ++
 arch/arm/boot/dts/omap3-sb-t35.dtsi   |   49 +
 arch/arm/boot/dts/omap3-sbc-t3517.dts |   14 +
 arch/arm/boot/dts/omap3-sbc-t3530.dts |   14 +
 arch/arm/boot/dts/omap3-sbc-t3730.dts |   14 +
 8 files changed, 176 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap3-cm-t3517.dts 
b/arch/arm/boot/dts/omap3-cm-t3517.dts
index d00502f..0ab748c 100644
--- a/arch/arm/boot/dts/omap3-cm-t3517.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3517.dts
@@ -134,3 +134,14 @@
bus-width = 4;
cap-power-off-card;
 };
+
+dss {
+   status = ok;
+
+   pinctrl-names = default;
+   pinctrl-0 = 
+   dss_dpi_pins_common
+   dss_dpi_pins_cm_t35x
+   ;
+};
+
diff --git a/arch/arm/boot/dts/omap3-cm-t3530.dts 
b/arch/arm/boot/dts/omap3-cm-t3530.dts
index d145849..8dd14fc 100644
--- a/arch/arm/boot/dts/omap3-cm-t3530.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3530.dts
@@ -46,3 +46,14 @@
bus-width = 4;
cap-power-off-card;
 };
+
+dss {
+   status = ok;
+
+   pinctrl-names = default;
+   pinctrl-0 = 
+   dss_dpi_pins_common
+   dss_dpi_pins_cm_t35x
+   ;
+};
+
diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts 
b/arch/arm/boot/dts/omap3-cm-t3730.dts
index b3f9a50..46eadb2 100644
--- a/arch/arm/boot/dts/omap3-cm-t3730.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
@@ -31,6 +31,19 @@
};
 };
 
+omap3_pmx_wkup {
+   dss_dpi_pins_cm_t3730: pinmux_dss_dpi_pins_cm_t3730 {
+   pinctrl-single,pins = 
+   OMAP3_WKUP_IOPAD(0x2a08, PIN_OUTPUT | MUX_MODE3)   /* 
sys_boot0.dss_data18 */
+   OMAP3_WKUP_IOPAD(0x2a0c, PIN_OUTPUT | MUX_MODE3)   /* 
sys_boot1.dss_data19 */
+   OMAP3_WKUP_IOPAD(0x2a10, PIN_OUTPUT | MUX_MODE3)   /* 
sys_boot3.dss_data20 */
+   OMAP3_WKUP_IOPAD(0x2a12, PIN_OUTPUT | MUX_MODE3)   /* 
sys_boot4.dss_data21 */
+   OMAP3_WKUP_IOPAD(0x2a14, PIN_OUTPUT | MUX_MODE3)   /* 
sys_boot5.dss_data22 */
+   OMAP3_WKUP_IOPAD(0x2a16, PIN_OUTPUT | MUX_MODE3)   /* 
sys_boot6.dss_data23 */
+   ;
+   };
+};
+
 omap3_pmx_core {
 
mmc2_pins: pinmux_mmc2_pins {
@@ -61,3 +74,14 @@
bus-width = 4;
cap-power-off-card;
 };
+
+dss {
+   status = ok;
+
+   pinctrl-names = default;
+   pinctrl-0 = 
+   dss_dpi_pins_common
+   dss_dpi_pins_cm_t3730
+   ;
+};
+
diff --git a/arch/arm/boot/dts/omap3-cm-t3x.dtsi 
b/arch/arm/boot/dts/omap3-cm-t3x.dtsi
index c671a22..b074673 100644
--- a/arch/arm/boot/dts/omap3-cm-t3x.dtsi
+++ b/arch/arm/boot/dts/omap3-cm-t3x.dtsi
@@ -76,6 +76,45 @@
OMAP3_CORE1_IOPAD(0x21e2, PIN_OUTPUT | MUX_MODE4)   
/* sys_clkout2.gpio_186 */
;
};
+
+   dss_dpi_pins_common: pinmux_dss_dpi_pins_common {
+   pinctrl-single,pins = 
+   OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0)   
/* dss_pclk.dss_pclk */
+   OMAP3_CORE1_IOPAD(0x20d6, PIN_OUTPUT | MUX_MODE0)   
/* dss_hsync.dss_hsync */
+   OMAP3_CORE1_IOPAD(0x20d8, PIN_OUTPUT | MUX_MODE0)   
/* dss_vsync.dss_vsync */
+   OMAP3_CORE1_IOPAD(0x20da, PIN_OUTPUT | MUX_MODE0)   
/* dss_acbias.dss_acbias */
+
+   OMAP3_CORE1_IOPAD(0x20e8, PIN_OUTPUT | MUX_MODE0)   
/* dss_data6.dss_data6 */
+   OMAP3_CORE1_IOPAD(0x20ea, PIN_OUTPUT | MUX_MODE0)   
/* dss_data7.dss_data7 */
+   OMAP3_CORE1_IOPAD(0x20ec, PIN_OUTPUT | MUX_MODE0)   
/* dss_data8.dss_data8 */
+   OMAP3_CORE1_IOPAD(0x20ee, PIN_OUTPUT | MUX_MODE0)   
/* dss_data9.dss_data9 */
+   OMAP3_CORE1_IOPAD(0x20f0, PIN_OUTPUT | MUX_MODE0)   
/* dss_data10.dss_data10 */
+   OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE0)   
/* dss_data11.dss_data11 */
+   OMAP3_CORE1_IOPAD(0x20f4, PIN_OUTPUT | MUX_MODE0)   
/* dss_data12.dss_data12 */
+   OMAP3_CORE1_IOPAD(0x20f6, PIN_OUTPUT | MUX_MODE0)   
/* dss_data13.dss_data13 */
+   OMAP3_CORE1_IOPAD(0x20f8, PIN_OUTPUT | MUX_MODE0)   
/* dss_data14.dss_data14 */
+   OMAP3_CORE1_IOPAD(0x20fa, 

Re: [PATCH v2] ARM: dts: sbc-t3x: add DVI display data

2014-11-02 Thread Igor Grinberg
On 11/02/14 13:19, Dmitry Lifshitz wrote:
 Add DSS related pinmux and display data nodes required to support
 DVI video out on SBC-T3530, SBC-T3730 and SBC-T3517.
 
 Signed-off-by: Dmitry Lifshitz lifsh...@compulab.co.il

Acked-by: Igor Grinberg grinb...@compulab.co.il


-- 
Regards,
Igor.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mfd: twl4030-power: Fix poweroff with PM configuration enabled

2014-11-02 Thread Tony Lindgren
Commit e7cd1d1eb16f (mfd: twl4030-power: Add generic reset
configuration) enabled configuring the PM features for twl4030.

This caused poweroff command to fail on devices that have the
BCI charger on twl4030 wired, or have power wired for VBUS.
Instead of powering off, the device reboots. This is because
voltage is detected on charger or VBUS with the default bits
enabled for the power transition registers.

To fix the issue, let's just clear VBUS and CHG bits as we want
poweroff command to keep the system powered off.

Fixes: e7cd1d1eb16f (mfd: twl4030-power: Add generic reset configuration)
Cc: sta...@vger.kernel.org # v3.16+
Reported-by: Russell King rmk+ker...@arm.linux.org.uk
Signed-off-by: Tony Lindgren t...@atomide.com

--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -44,6 +44,15 @@ static u8 twl4030_start_script_address = 0x2b;
 #define PWR_DEVSLP BIT(1)
 #define PWR_DEVOFF BIT(0)
 
+/* Register bits for CFG_P1_TRANSITION (also for P2 and P3) */
+#define STARTON_SWBUG  BIT(7)  /* Start on watchdog */
+#define STARTON_VBUS   BIT(5)  /* Start on VBUS */
+#define STARTON_VBAT   BIT(4)  /* Start on battery insert */
+#define STARTON_RTCBIT(3)  /* Start on RTC */
+#define STARTON_USBBIT(2)  /* Start on USB host */
+#define STARTON_CHGBIT(1)  /* Start on charger */
+#define STARTON_PWON   BIT(0)  /* Start on PWRON button */
+
 #define SEQ_OFFSYNC(1  0)
 
 #define PHY_TO_OFF_PM_MASTER(p)(p - 0x36)
@@ -606,6 +615,44 @@ twl4030_power_configure_resources(const struct 
twl4030_power_data *pdata)
return 0;
 }
 
+static int twl4030_starton_mask_and_set(u8 bitmask, u8 bitvalues)
+{
+   u8 regs[3] = { TWL4030_PM_MASTER_CFG_P1_TRANSITION,
+  TWL4030_PM_MASTER_CFG_P2_TRANSITION,
+  TWL4030_PM_MASTER_CFG_P3_TRANSITION, };
+   u8 val;
+   int i, err;
+
+   err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1,
+  TWL4030_PM_MASTER_PROTECT_KEY);
+   if (err)
+   goto relock;
+   err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
+  TWL4030_PM_MASTER_KEY_CFG2,
+  TWL4030_PM_MASTER_PROTECT_KEY);
+   if (err)
+   goto relock;
+
+   for (i = 0; i  sizeof(regs); i++) {
+   err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER,
+ val, regs[i]);
+   if (err)
+   break;
+   val = (~bitmask  val) | (bitmask  bitvalues);
+   err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
+  val, regs[i]);
+   if (err)
+   break;
+   }
+
+   if (err)
+   pr_err(TWL4030 Register access failed: %i\n, err);
+
+relock:
+   return twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0,
+   TWL4030_PM_MASTER_PROTECT_KEY);
+}
+
 /*
  * In master mode, start the power off sequence.
  * After a successful execution, TWL shuts down the power to the SoC
@@ -615,6 +662,11 @@ void twl4030_power_off(void)
 {
int err;
 
+   /* Disable start on charger or VBUS as it can break poweroff */
+   err = twl4030_starton_mask_and_set(STARTON_VBUS | STARTON_CHG, 0);
+   if (err)
+   pr_err(TWL4030 Unable to configure start-up\n);
+
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, PWR_DEVOFF,
   TWL4030_PM_MASTER_P1_SW_EVENTS);
if (err)
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mfd: twl4030-power: Fix regression with missing compatible flag

2014-11-02 Thread Tony Lindgren
Commit e7cd1d1eb16f (mfd: twl4030-power: Add generic reset
configuration) accidentally removed the compatible flag for
ti,twl4030-power that should be there as documented in the
binding.

If ti,twl4030-power only the poweroff configuration is done
by the driver.

Fixes: e7cd1d1eb16f (mfd: twl4030-power: Add generic reset configuration)
Cc: sta...@vger.kernel.org # v3.16+
Reported-by: Dr. H. Nikolaus Schaller h...@goldelico.com
Signed-off-by: Tony Lindgren t...@atomide.com

--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -831,6 +831,9 @@ static struct twl4030_power_data osc_off_idle = {
 
 static struct of_device_id twl4030_power_of_match[] = {
{
+   .compatible = ti,twl4030-power,
+   },
+   {
.compatible = ti,twl4030-power-reset,
.data = omap3_reset,
},
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: OMAP2+: Warn about deprecated legacy booting mode

2014-11-02 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [141101 15:00]:
 * Russell King - ARM Linux li...@arm.linux.org.uk [141031 17:46]:
  
  However, these are minor compared to the dreadful poweroff behaviour.
  Still going to have to disable DT booting for the LDP because of that.
 
 Sure, I'll let you know as soon as I have something available
 for the PMIC powerdown issue.

OK found the problem. The PMIC power transition register needs to
have charger and VBUS bits disabled to prevent immediate reboot
on powerdown for some boards.

Fix posted as mfd: twl4030-power: Fix poweroff with PM configuration
enabled:

https://lkml.org/lkml/2014/11/2/114

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] omap fixes against v3.18-rc2

2014-11-02 Thread Olof Johansson
On Thu, Oct 30, 2014 at 09:50:20AM -0700, Tony Lindgren wrote:
 The following changes since commit cac7f2429872d3733dc3f9915857b1691da2eb2f:
 
   Linux 3.18-rc2 (2014-10-26 16:48:41 -0700)
 
 are available in the git repository at:
 
   git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap 
 tags/fixes-against-v3.18-rc2
 
 for you to fetch changes up to 4b91f7f3c8b20e073b7bfc098625b37f99789508:
 
   ARM: OMAP2+: Warn about deprecated legacy booting mode (2014-10-29 12:19:20 
 -0700)

Thanks, merged.

 
 
 Few fixes for omaps to enable NAND BCH so devices won't
 produce errors when booted with omap2plus_defconfig, and
 reduce bloat by making IPV6 a loadable module.
 
 Also let's add a warning about legacy boot being deprecated
 for omap3.
 
 We now have things working with device tree, and only omap3 is
 still booting in legacy mode. So hopefully this warning will
 help move the remaining legacy mode users to boot with device
 tree.

Hm, I think I saw Russell commenting recently about migrating back from
DT to legacy boot on a 3430 board.

 As the total reduction of code and static data is somewhere
 around 2 lines of code once we remove omap3 legacy mode
 booting, we really do want to make omap3 to boot also in
 device tree mode only over the next few merge cycles.

Yep, that'd be nice.


-Olof
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] omap fixes against v3.18-rc2

2014-11-02 Thread Tony Lindgren
* Olof Johansson o...@lixom.net [141102 15:30]:
 On Thu, Oct 30, 2014 at 09:50:20AM -0700, Tony Lindgren wrote:
  The following changes since commit cac7f2429872d3733dc3f9915857b1691da2eb2f:
  
Linux 3.18-rc2 (2014-10-26 16:48:41 -0700)
  
  are available in the git repository at:
  
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap 
  tags/fixes-against-v3.18-rc2
  
  for you to fetch changes up to 4b91f7f3c8b20e073b7bfc098625b37f99789508:
  
ARM: OMAP2+: Warn about deprecated legacy booting mode (2014-10-29 
  12:19:20 -0700)
 
 Thanks, merged.
 
  
  
  Few fixes for omaps to enable NAND BCH so devices won't
  produce errors when booted with omap2plus_defconfig, and
  reduce bloat by making IPV6 a loadable module.
  
  Also let's add a warning about legacy boot being deprecated
  for omap3.
  
  We now have things working with device tree, and only omap3 is
  still booting in legacy mode. So hopefully this warning will
  help move the remaining legacy mode users to boot with device
  tree.
 
 Hm, I think I saw Russell commenting recently about migrating back from
 DT to legacy boot on a 3430 board.

I posted a fix for the PMIC that fixes the poweroff issue for
boards with charger or VBUS wired. So hopefully Russell can switch
his LDP over finally.
 
  As the total reduction of code and static data is somewhere
  around 2 lines of code once we remove omap3 legacy mode
  booting, we really do want to make omap3 to boot also in
  device tree mode only over the next few merge cycles.
 
 Yep, that'd be nice.

Indeed.

Thanks,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html