Re: [PATCH 00/11] OMAP3 CPUidle patches

2008-07-03 Thread Högander Jouni
ext Rajendra Nayak [EMAIL PROTECTED] writes:

 Hi,

 The following patches define and enable all of the below mentioned C states 
 for OMAP3. 
 These are tested with a minimal kernel config on OMAP3430sdp as most drivers 
 today don't have context save/restore in place and
 some even lack aggresive clock handling. 
 These apply on top of the workaround patch set submitted by Jouni. 
 ([PATCH 0/6] 34XX: PM: Workarounds to get omap3 to retention 4th.)

 The following is neccessay even with a minimal config to achieve OFF.
  $ echo 1  /sys/power/sleep_while_idle
  $ echo 1  /sys/power/clocks_off_while_idle
   
 The following C states are defined
 C0 - System executing code
 C1 - MPU WFI + Core active
 C2 - MPU CSWR + Core active
 C3 - MPU OFF + Core active
 C4 - MPU CSWR + Core CSWR
 C5 - MPU OFF + Core CSWR
 C6 - MPU OFF + Core OFF
  
 regards,
 Rajendra

One more general comment on these patches as I looked at the code
after applying them.

Most of the code in omap3_enter_idle in cpuidle34xx.c could be shared
between suspend/pm_idle/cpuidle. I would do these changes to share
this code between these three things:

1. read mpu_pd pwrst, neon_pd pwrst, core_pd pwrst values in
   omap_sram_idle in pm34xx.c

2. Move all the logic from omap3_enter_idle to omap_sram_idle. Use
   values read in previous step to decide wether ctx savings/restores
   are needed, what should be written to neon_pd next_pwrst, wether
   omap2_gpio_prepare_for/resume_after_retention is needed, wether to
   disable/enable serial and gpio clocks.

Basically what is left into omap3_enter_idle is writing next pwrsts
and cpuidle related stuff, something like this:

static int omap3_enter_idle(struct cpuidle_device *dev,
struct cpuidle_state *state)
{
struct omap3_processor_cx *cx = cpuidle_get_statedata(state);
struct timespec ts_preidle, ts_postidle, ts_idle;
struct powerdomain *mpu_pd, *core_pd;

current_cx_state = *cx;

if (cx-type == OMAP3_STATE_C0) {
/* Do nothing for C0, not even a wfi */
return 0;
}

local_irq_disable();
local_fiq_disable();

/* Used to keep track of the total time in idle */
getnstimeofday(ts_preidle);

if (cx-type  OMAP3_STATE_C1)
sched_clock_idle_sleep_event(); /* about to enter deep idle */

mpu_pd = pwrdm_lookup(mpu_pwrdm);
core_pd = pwrdm_lookup(core_pwrdm);

pwrdm_set_next_pwrst(mpu_pd, cx-mpu_state);
pwrdm_set_next_pwrst(core_pd, cx-core_state);

if (omap_irq_pending())
goto return_sleep_time;

/* Execute ARM wfi */
omap_sram_idle();

return_sleep_time:
getnstimeofday(ts_postidle);
ts_idle = timespec_sub(ts_postidle, ts_preidle);

if (cx-type  OMAP3_STATE_C1)
sched_clock_idle_wakeup_event(timespec_to_ns(ts_idle));

local_irq_enable();
local_fiq_disable();

return (u32)timespec_to_ns(ts_idle)/1000;
}

If this is not done, we need to copy paste code from omap3_enter_idle
into suspend code anyway if we want to use offmode in it. It would be
more nice to have one funcion with this logic shared between
suspend/pm_idle/cpuidle rather than two or even three copies of it.

-- 
Jouni Högander

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


[PATCH 0/2] IrDA support for 3430

2008-07-03 Thread Girish. S. G.
Hi,
Please find the patch series to enable IrDA on 3430

Patch 1/2 : Adds the driver specific changes.

Patch 2/2 : Adds board specific changes.

Regards,
Girish

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


[PATCH 2/2] ARM:OMAP2: irda support 3430

2008-07-03 Thread Girish. S. G.
This adds board specific changes to support IrDA on 3430

Signed-off-by: Girish S G [EMAIL PROTECTED]
---
 arch/arm/configs/omap_3430sdp_defconfig |   34 +++
 arch/arm/mach-omap2/board-3430sdp.c |  145 
 arch/arm/mach-omap2/mux.c   |   16 +++
 include/asm-arm/arch-omap/gpio.h|3
 include/asm-arm/arch-omap/mux.h |9 +
 5 files changed, 204 insertions(+), 3 deletions(-)

Index: linux-omap-2.6/arch/arm/configs/omap_3430sdp_defconfig
===
--- linux-omap-2.6.orig/arch/arm/configs/omap_3430sdp_defconfig 2008-07-02
18:54:15.0 +0530
+++ linux-omap-2.6/arch/arm/configs/omap_3430sdp_defconfig  2008-07-02
18:56:41.0 +0530
@@ -392,7 +392,39 @@
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_CAN is not set
-# CONFIG_IRDA is not set
+CONFIG_IRDA=y
+
+#
+# IrDA protocols
+#
+# CONFIG_IRLAN is not set
+CONFIG_IRCOMM=y
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+# CONFIG_IRDA_DEBUG is not set
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+# CONFIG_IRTTY_SIR is not set
+
+#
+# Dongle support
+#
+
+#
+# FIR device drivers
+#
+CONFIG_OMAP_IR=y
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set

Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2008-07-02
18:54:15.0 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c  2008-07-02
18:56:41.0 +0530
@@ -32,6 +32,7 @@
 #include asm/arch/mcspi.h
 #include asm/arch/gpio.h
 #include asm/arch/mux.h
+#include asm/arch/irda.h
 #include asm/arch/board.h
 #include asm/arch/usb-musb.h
 #include asm/arch/usb-ehci.h
@@ -46,6 +47,9 @@

 #defineSDP3430_SMC91X_CS   3

+#define ENABLE_VAUX1_DEDICATED 0x03
+#define ENABLE_VAUX1_DEV_GRP   0x20
+
 #define ENABLE_VAUX3_DEDICATED 0x03
 #define ENABLE_VAUX3_DEV_GRP   0x20

@@ -70,6 +74,146 @@
.resource   = sdp3430_smc91x_resources,
 };

+/* IrDA
+ */
+#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
+
+#defineIRDA_SD 164 /* gpio 164 */
+#defineIRDA_TX 166 /* gpio 166 */
+#defineIRDA_SD_PIN T21_3430_GPIO164
+#defineIRDA_TX_PIN V21_3430_GPIO166
+
+#define IRDA_VAUX_EN   1
+#define IRDA_VAUX_DIS  0
+
+/*
+ * This enable(1)/disable(0) the voltage for IrDA: uses twl4030 calls
+ */
+static int irda_vaux_control(int vaux_cntrl)
+{
+   int ret = 0;
+
+#ifdef CONFIG_TWL4030_CORE
+   /* check for return value of ldo_use: if success it returns 0 */
+   if (vaux_cntrl == IRDA_VAUX_EN) {
+   if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   ENABLE_VAUX1_DEDICATED, TWL4030_VAUX1_DEDICATED))
+   return -EIO;
+   if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   ENABLE_VAUX1_DEV_GRP, TWL4030_VAUX1_DEV_GRP))
+   return -EIO;
+   } else if (vaux_cntrl == IRDA_VAUX_DIS) {
+   if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   0x00, TWL4030_VAUX1_DEDICATED))
+   return -EIO;
+   if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+   0x00, TWL4030_VAUX1_DEV_GRP))
+   return -EIO;
+   }
+#else
+   ret = -EIO;
+#endif
+   return ret;
+}
+
+static int select_irda(struct device *dev, int state)
+{
+   int err;
+   if (state == IR_SEL) {
+   err = irda_vaux_control(IRDA_VAUX_EN);
+   if (err != 0) {
+   printk(KERN_ERR OMAP: IrDA vaux enable failed\n);
+   return err;
+   }
+
+   omap_cfg_reg(R21_3430_UART3_CTS_RCTX);
+   omap_cfg_reg(T21_3430_UART3_RTS_SD);
+   omap_cfg_reg(U21_3430_UART3_RX_IRRX);
+   omap_cfg_reg(V21_3430_UART3_TX_IRTX);
+
+   omap_request_gpio(IRDA_SD);
+   omap_request_gpio(IRDA_TX);
+   omap_cfg_reg(IRDA_SD_PIN);
+   omap_set_gpio_direction(IRDA_SD, GPIO_DIR_OUTPUT);
+   omap_set_gpio_direction(IRDA_TX, GPIO_DIR_OUTPUT);
+   omap_set_gpio_dataout(IRDA_SD, 0);
+   } else {
+   omap_free_gpio(IRDA_SD);
+   omap_free_gpio(IRDA_TX);
+   err = irda_vaux_control(IRDA_VAUX_EN);
+   if (err != 0) {
+   printk(KERN_ERR OMAP: IrDA vaux Enable failed\n);
+   return err;
+   }
+   }
+
+   return 0;
+}
+
+static int transceiver_mode(struct device *dev, int mode)
+{
+   omap_cfg_reg(IRDA_SD_PIN);
+   omap_cfg_reg(IRDA_TX_PIN);
+
+   if (mode  

[PATCH 1/2] driver: irda support 3430

2008-07-03 Thread Girish. S. G.
Irda driver changes to support on 3430

Signed-off-by: Girish S G [EMAIL PROTECTED]
---
 drivers/net/irda/omap-ir.c |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

Index: linux-omap-2.6_today/drivers/net/irda/omap-ir.c
===
--- linux-omap-2.6_today.orig/drivers/net/irda/omap-ir.c2008-07-03
10:33:57.0 +0530
+++ linux-omap-2.6_today/drivers/net/irda/omap-ir.c 2008-07-03
10:35:30.0 +0530
@@ -217,7 +217,7 @@
struct net_device *dev = data;
struct omap_irda *omap_ir = netdev_priv(dev);

-   /*Stop DMA controller */
+   /* Stop DMA controller */
omap_stop_dma(omap_ir-tx_dma_channel);
 }

@@ -378,8 +378,12 @@

skb_reserve(skb, 1);

-   w = omap_get_dma_dst_pos(omap_ir-rx_dma_channel) -
-   omap_ir-rx_buf_dma_phys;
+   w = OMAP_DMA4_CDAC(omap_ir-rx_dma_channel);
+
+   if (cpu_is_omap16xx())
+   w -= OMAP1_DMA_CDSA_L(omap_ir-rx_dma_channel);
+   if (cpu_is_omap24xx() || cpu_is_omap34xx())
+   w -= OMAP_DMA4_CDSA(omap_ir-rx_dma_channel);

if (!IS_FIR(omap_ir))
/* Copy DMA buffer to skb */
@@ -604,6 +608,8 @@
 err_irlap:
omap_ir-open = 0;
omap_irda_shutdown(omap_ir);
+   if (omap_ir-pdata-select_irda)
+   omap_ir-pdata-select_irda(omap_ir-dev, ~IR_SEL);
 err_startup:
dma_free_coherent(NULL, IRDA_SIR_MAX_FRAME,
omap_ir-tx_buf_dma_virt, omap_ir-tx_buf_dma_phys);
@@ -636,6 +642,8 @@
omap_ir-tx_buf_dma_phys);

omap_irda_shutdown(omap_ir);
+   if (omap_ir-pdata-select_irda)
+   omap_ir-pdata-select_irda(omap_ir-dev, ~IR_SEL);

/* Stop IrLAP */
if (omap_ir-irlap) {

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


[PATCH] OMAP3 CPUidle patches - fixes

2008-07-03 Thread Rajendra Nayak
This patch fixes few of the comments posted on the patch set till now. 

One major fix is the moving of uart clock enable/disable out of the context 
save path as pointed out by Jouni. 
This would leave the UART clcoks disabled in case a CORE OFF was attempted and 
not achieved.


Signed-off-by: Rajendra Nayak [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/cpuidle34xx.c |   56 ++
 1 files changed, 22 insertions(+), 34 deletions(-)

Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.c   2008-07-03 
10:50:04.0 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c2008-07-03 
13:11:13.435048828 +0530
@@ -405,9 +405,7 @@ void omap3_save_core_ctx(void)
/* Save the system control module context, padconf already save above*/
omap_save_control_ctx();
omap_save_uart_ctx(0);
-   omap_serial_enable_clocks(0, 0);
omap_save_uart_ctx(1);
-   omap_serial_enable_clocks(0, 1);
 }
 
 void omap3_restore_core_ctx(void)
@@ -418,9 +416,7 @@ void omap3_restore_core_ctx(void)
omap_restore_gpmc_ctx();
/* Restore the interrupt controller context */
omap_restore_intc_ctx();
-   omap_serial_enable_clocks(1, 0);
omap_restore_uart_ctx(0);
-   omap_serial_enable_clocks(1, 1);
omap_restore_uart_ctx(1);
padconf_saved = 0;
 }
@@ -472,28 +468,27 @@ static int omap3_enter_idle(struct cpuid
 
/* Program MPU to target state */
if (cx-mpu_state  PWRDM_POWER_ON) {
-   if (neon_pwrst == PWRDM_POWER_ON) {
-   if (cx-mpu_state == PWRDM_POWER_RET)
-   pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
-   else if (cx-mpu_state == PWRDM_POWER_OFF)
-   pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_OFF);
-   }
+   pwrdm_set_next_pwrst(neon_pd, cx-mpu_state);
pwrdm_set_next_pwrst(mpu_pd, cx-mpu_state);
}
 
/* Program CORE and PER to target state */
if (cx-core_state  PWRDM_POWER_ON) {
-   if (per_pwrst == PWRDM_POWER_ON) {
-   omap2_gpio_prepare_for_retention();
-   if (clocks_off_while_idle) {
-   omap3_save_per_ctx();
-   per_gpio_clk_disable();
-   omap_save_uart_ctx(2);
-   omap_serial_enable_clocks(0, 2);
-   }
+   omap2_gpio_prepare_for_retention();
+   if (clocks_off_while_idle) {
+   omap3_save_per_ctx();
+   per_gpio_clk_disable();
+   omap_save_uart_ctx(2);
+   omap_serial_enable_clocks(0, 2);
}
if (cx-core_state == PWRDM_POWER_OFF)
omap3_save_core_ctx();
+   /* Disable UART1/UART2 clocks here. Done using direct register
+   * writes as using clock f/w calls results in a hang in prcm_
+   * interrupt_handler trying to clear WKST for CORE
+   */
+   cm_clear_mod_reg_bits(0x6000, CORE_MOD, CM_ICLKEN1);
+   cm_clear_mod_reg_bits(0x6000, CORE_MOD, CM_FCLKEN1);
pwrdm_set_next_pwrst(core_pd, cx-core_state);
}
 
@@ -507,14 +502,9 @@ static int omap3_enter_idle(struct cpuid
 
*(scratchpad_restore_addr) = 0x0;
 
-   /* Program MPU/NEON to ON */
-   if (cx-mpu_state  PWRDM_POWER_ON) {
-   if (neon_pwrst == PWRDM_POWER_ON)
-   pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_ON);
-   pwrdm_set_next_pwrst(mpu_pd, PWRDM_POWER_ON);
-   }
-
if (cx-core_state  PWRDM_POWER_ON) {
+   cm_set_mod_reg_bits(0x6000, CORE_MOD, CM_ICLKEN1);
+   cm_set_mod_reg_bits(0x6000, CORE_MOD, CM_FCLKEN1);
if ((cx-core_state == PWRDM_POWER_OFF)
 (pwrdm_read_prev_pwrst(core_pd) == PWRDM_POWER_OFF)) {
omap3_restore_core_ctx();
@@ -522,15 +512,13 @@ static int omap3_enter_idle(struct cpuid
omap3_restore_sram_ctx();
}
pwrdm_set_next_pwrst(core_pd, PWRDM_POWER_ON);
-   if (per_pwrst == PWRDM_POWER_ON) {
-   if (clocks_off_while_idle) {
-   omap_serial_enable_clocks(1, 2);
-   omap_restore_uart_ctx(2);
-   per_gpio_clk_enable();
-   omap3_restore_per_ctx();
-   }
-   omap2_gpio_resume_after_retention();
+   if (clocks_off_while_idle) {
+   omap_serial_enable_clocks(1, 2);
+   

RE: [PATCH 00/11] OMAP3 CPUidle patches

2008-07-03 Thread Rajendra Nayak
 -Original Message-
 From: Peter 'p2' De Schrijver [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, July 02, 2008 9:13 PM
 To: ext Rajendra Nayak
 Cc: linux-omap@vger.kernel.org
 Subject: Re: [PATCH 00/11] OMAP3 CPUidle patches
 
 Hi Rajendra,
 
  
  Not sure, but you can try with my .config while I try with yours. 
  I was doing some more testing today, and I saw a hang after 
 a while of
  idle activity with OFF being attempted multiple times.
  Using lauterbach showed me it being stuck up in 
 prcm_interrupt_handler trying 
  to clear MPU_IRQSTATUS.
  Looks like in the PRCM interrupt handler somehow 
 PM_WKST1_CORE is not cleared
  (I see it set to 0x2000) and hence MPU_IRQSTATUS fails to clear.
  
 
 Ok. I disabled OneNAND support and now I get off mode on VDD2 as well.
 Consumption on VDD1 is 4uA and 32uA on VDD2. Unfortunately after the
 first wakeup, off mode is never reached again.

Do you see a hang? or OFF is never achieved?
Can you try with the latest fixes that I posted.

 
 Cheers,
 
 Peter.
 

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


Re: [PATCH 2/2] ARM:OMAP2: irda support 3430

2008-07-03 Thread Girish S G
- Original Message - 
From: Trilok Soni [EMAIL PROTECTED]



+static struct omap_irda_config irda_data = {
+   .transceiver_cap= IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
+   .transceiver_mode   = transceiver_mode,
+   .select_irda= select_irda,



Please rename this hooks to 3430sdp_transceiver_mode and
3430sdp_select_irda. Check board_h4.c for example.

I think it can be made irda_transceiver_mode/irda_select.  And, as this is in 3430 board file, prefixing it with 3430sdp serves no 
purpose i guess.




+   .rx_channel = OMAP24XX_DMA_UART3_RX,
+   .tx_channel = OMAP24XX_DMA_UART3_TX,
+   .dest_start = OMAP_UART3_BASE,
+   .src_start  = OMAP_UART3_BASE,
+   .tx_trigger = OMAP24XX_DMA_UART3_TX,
+   .rx_trigger = OMAP24XX_DMA_UART3_RX,
+};


Actually rx_channel to rx_trigger are not platform data and it is long
pending cleanup. It would great if we can convert this to
platform_resource, as it is chip specific not board specific.


Yes, I agree.


-girish 


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


RE: [PATCH 00/11] OMAP3 CPUidle patches

2008-07-03 Thread Rajendra Nayak
 

 -Original Message-
 From: Högander Jouni [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, July 03, 2008 11:28 AM
 To: ext Rajendra Nayak
 Cc: linux-omap@vger.kernel.org
 Subject: Re: [PATCH 00/11] OMAP3 CPUidle patches
 
 ext Rajendra Nayak [EMAIL PROTECTED] writes:
 
  Hi,
 
  The following patches define and enable all of the below 
 mentioned C states for OMAP3. 
  These are tested with a minimal kernel config on 
 OMAP3430sdp as most drivers today don't have context 
 save/restore in place and
  some even lack aggresive clock handling. 
  These apply on top of the workaround patch set submitted by Jouni. 
  ([PATCH 0/6] 34XX: PM: Workarounds to get omap3 to retention 4th.)
 
  The following is neccessay even with a minimal config to 
 achieve OFF.
   $ echo 1  /sys/power/sleep_while_idle
   $ echo 1  /sys/power/clocks_off_while_idle

  The following C states are defined
  C0 - System executing code
  C1 - MPU WFI + Core active
  C2 - MPU CSWR + Core active
  C3 - MPU OFF + Core active
  C4 - MPU CSWR + Core CSWR
  C5 - MPU OFF + Core CSWR
  C6 - MPU OFF + Core OFF
   
  regards,
  Rajendra
 
 One more general comment on these patches as I looked at the code
 after applying them.
 
 Most of the code in omap3_enter_idle in cpuidle34xx.c could be shared
 between suspend/pm_idle/cpuidle. I would do these changes to share
 this code between these three things:
 
 1. read mpu_pd pwrst, neon_pd pwrst, core_pd pwrst values in
omap_sram_idle in pm34xx.c
 
 2. Move all the logic from omap3_enter_idle to omap_sram_idle. Use
values read in previous step to decide wether ctx savings/restores
are needed, what should be written to neon_pd next_pwrst, wether
omap2_gpio_prepare_for/resume_after_retention is needed, wether to
disable/enable serial and gpio clocks.
 
 Basically what is left into omap3_enter_idle is writing next pwrsts
 and cpuidle related stuff, something like this:
 
 static int omap3_enter_idle(struct cpuidle_device *dev,
   struct cpuidle_state *state)
 {
   struct omap3_processor_cx *cx = cpuidle_get_statedata(state);
   struct timespec ts_preidle, ts_postidle, ts_idle;
   struct powerdomain *mpu_pd, *core_pd;
 
   current_cx_state = *cx;
 
   if (cx-type == OMAP3_STATE_C0) {
   /* Do nothing for C0, not even a wfi */
   return 0;
   }
 
   local_irq_disable();
   local_fiq_disable();
 
   /* Used to keep track of the total time in idle */
   getnstimeofday(ts_preidle);
 
   if (cx-type  OMAP3_STATE_C1)
   sched_clock_idle_sleep_event(); /* about to 
 enter deep idle */
 
   mpu_pd = pwrdm_lookup(mpu_pwrdm);
   core_pd = pwrdm_lookup(core_pwrdm);
 
 pwrdm_set_next_pwrst(mpu_pd, cx-mpu_state);
   pwrdm_set_next_pwrst(core_pd, cx-core_state);
 
   if (omap_irq_pending())
   goto return_sleep_time;
 
   /* Execute ARM wfi */
   omap_sram_idle();
 
 return_sleep_time:
   getnstimeofday(ts_postidle);
   ts_idle = timespec_sub(ts_postidle, ts_preidle);
 
   if (cx-type  OMAP3_STATE_C1)
   sched_clock_idle_wakeup_event(timespec_to_ns(ts_idle));
 
   local_irq_enable();
   local_fiq_disable();
 
   return (u32)timespec_to_ns(ts_idle)/1000;
 }
 
 If this is not done, we need to copy paste code from omap3_enter_idle
 into suspend code anyway if we want to use offmode in it. It would be
 more nice to have one funcion with this logic shared between
 suspend/pm_idle/cpuidle rather than two or even three copies of it.

Yes, all this looks good to me.

 
 -- 
 Jouni Högander
 
 

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


Re: [PATCH 2/2] ARM:OMAP2: irda support 3430

2008-07-03 Thread Trilok Soni
Hi Girish,

On Thu, Jul 3, 2008 at 12:15 PM, Girish. S. G. [EMAIL PROTECTED] wrote:
 This adds board specific changes to support IrDA on 3430

 Signed-off-by: Girish S G [EMAIL PROTECTED]
 ---
  arch/arm/configs/omap_3430sdp_defconfig |   34 +++
  arch/arm/mach-omap2/board-3430sdp.c |  145 
 
  arch/arm/mach-omap2/mux.c   |   16 +++
  include/asm-arm/arch-omap/gpio.h|3
  include/asm-arm/arch-omap/mux.h |9 +
  5 files changed, 204 insertions(+), 3 deletions(-)

 Index: linux-omap-2.6/arch/arm/configs/omap_3430sdp_defconfig
 ===
 --- linux-omap-2.6.orig/arch/arm/configs/omap_3430sdp_defconfig 2008-07-02
 18:54:15.0 +0530
 +++ linux-omap-2.6/arch/arm/configs/omap_3430sdp_defconfig  2008-07-02
 18:56:41.0 +0530
 @@ -392,7 +392,39 @@
  # CONFIG_NET_PKTGEN is not set
  # CONFIG_HAMRADIO is not set
  # CONFIG_CAN is not set
 -# CONFIG_IRDA is not set
 +CONFIG_IRDA=y
 +
 +#
 +# IrDA protocols
 +#
 +# CONFIG_IRLAN is not set
 +CONFIG_IRCOMM=y
 +# CONFIG_IRDA_ULTRA is not set
 +
 +#
 +# IrDA options
 +#
 +CONFIG_IRDA_CACHE_LAST_LSAP=y
 +CONFIG_IRDA_FAST_RR=y
 +# CONFIG_IRDA_DEBUG is not set
 +
 +#
 +# Infrared-port device drivers
 +#
 +
 +#
 +# SIR device drivers
 +#
 +# CONFIG_IRTTY_SIR is not set
 +
 +#
 +# Dongle support
 +#
 +
 +#
 +# FIR device drivers
 +#
 +CONFIG_OMAP_IR=y
  # CONFIG_BT is not set
  # CONFIG_AF_RXRPC is not set

 Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
 ===
 --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2008-07-02
 18:54:15.0 +0530
 +++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c  2008-07-02
 18:56:41.0 +0530
 @@ -32,6 +32,7 @@
  #include asm/arch/mcspi.h
  #include asm/arch/gpio.h
  #include asm/arch/mux.h
 +#include asm/arch/irda.h
  #include asm/arch/board.h
  #include asm/arch/usb-musb.h
  #include asm/arch/usb-ehci.h
 @@ -46,6 +47,9 @@

  #defineSDP3430_SMC91X_CS   3

 +#define ENABLE_VAUX1_DEDICATED 0x03
 +#define ENABLE_VAUX1_DEV_GRP   0x20
 +
  #define ENABLE_VAUX3_DEDICATED 0x03
  #define ENABLE_VAUX3_DEV_GRP   0x20

 @@ -70,6 +74,146 @@
.resource   = sdp3430_smc91x_resources,
  };

 +/* IrDA
 + */
 +#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
 +
 +#defineIRDA_SD 164 /* gpio 164 */
 +#defineIRDA_TX 166 /* gpio 166 */
 +#defineIRDA_SD_PIN T21_3430_GPIO164
 +#defineIRDA_TX_PIN V21_3430_GPIO166
 +
 +#define IRDA_VAUX_EN   1
 +#define IRDA_VAUX_DIS  0
 +
 +/*
 + * This enable(1)/disable(0) the voltage for IrDA: uses twl4030 calls
 + */
 +static int irda_vaux_control(int vaux_cntrl)
 +{
 +   int ret = 0;
 +
 +#ifdef CONFIG_TWL4030_CORE
 +   /* check for return value of ldo_use: if success it returns 0 */
 +   if (vaux_cntrl == IRDA_VAUX_EN) {
 +   if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
 +   ENABLE_VAUX1_DEDICATED, TWL4030_VAUX1_DEDICATED))
 +   return -EIO;
 +   if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
 +   ENABLE_VAUX1_DEV_GRP, TWL4030_VAUX1_DEV_GRP))
 +   return -EIO;
 +   } else if (vaux_cntrl == IRDA_VAUX_DIS) {
 +   if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
 +   0x00, TWL4030_VAUX1_DEDICATED))
 +   return -EIO;
 +   if (ret != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
 +   0x00, TWL4030_VAUX1_DEV_GRP))
 +   return -EIO;
 +   }
 +#else
 +   ret = -EIO;
 +#endif
 +   return ret;
 +}
 +
 +static int select_irda(struct device *dev, int state)
 +{
 +   int err;
 +   if (state == IR_SEL) {
 +   err = irda_vaux_control(IRDA_VAUX_EN);
 +   if (err != 0) {
 +   printk(KERN_ERR OMAP: IrDA vaux enable failed\n);
 +   return err;
 +   }
 +
 +   omap_cfg_reg(R21_3430_UART3_CTS_RCTX);
 +   omap_cfg_reg(T21_3430_UART3_RTS_SD);
 +   omap_cfg_reg(U21_3430_UART3_RX_IRRX);
 +   omap_cfg_reg(V21_3430_UART3_TX_IRTX);
 +
 +   omap_request_gpio(IRDA_SD);
 +   omap_request_gpio(IRDA_TX);
 +   omap_cfg_reg(IRDA_SD_PIN);
 +   omap_set_gpio_direction(IRDA_SD, GPIO_DIR_OUTPUT);
 +   omap_set_gpio_direction(IRDA_TX, GPIO_DIR_OUTPUT);
 +   omap_set_gpio_dataout(IRDA_SD, 0);
 +   } else {
 +   omap_free_gpio(IRDA_SD);
 +   omap_free_gpio(IRDA_TX);
 +   err = irda_vaux_control(IRDA_VAUX_EN);
 +   if (err != 0) {
 +   printk(KERN_ERR OMAP: IrDA vaux Enable failed\n);
 +   

Re: [PATCH] OMAP2/3 PM: Add OMAP PM no-op layer

2008-07-03 Thread Ramesh Gupta G

Hi Paul,



Perhaps something similar to an OMAP PM function
omap_pm_dsp_get_opp_table() that DSPBridge could call on startup?


Can you please provide tentative dates for the patches available with above 
function?


thanks
Ramesh Gupta G 


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


[Resending - PATCH 1/3] Triton BCI driver device setup for OMAP3430

2008-07-03 Thread Madhusudhan Chikkature
Hi Tony,

I am resending the BCI patch series after fixing the comments provided by 
Filipe.

Regards,
Madhu
-

From: Madhusudhan Chikkature[EMAIL PROTECTED]

Device setup/initialization for the Triton battery charger interface driver for
the OMAP3430 SDP.

Signed-off-by: Madhusudhan Chikkature[EMAIL PROTECTED]
---
 arch/arm/mach-omap2/Makefile  |3 +-
 arch/arm/mach-omap2/bci.c |   34 ++
 arch/arm/mach-omap2/board-3430sdp.c   |1
 include/asm-arm/arch-omap/board-3430sdp.h |1
 4 files changed, 38 insertions(+), 1 deletion(-)

Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/Makefile2008-07-03
16:58:02.0 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/Makefile 2008-07-03 16:58:30.0
+0530
@@ -47,7 +47,8 @@ obj-$(CONFIG_MACH_OMAP_3430SDP)   += boar
   hsmmc.o \
   usb-musb.o \
   usb-ehci.o \
-  board-3430sdp-flash.o
+  board-3430sdp-flash.o \
+  bci.o
 obj-$(CONFIG_MACH_OMAP3EVM)+= board-omap3evm.o \
   hsmmc.o \
   usb-musb.o usb-ehci.o \
Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2008-07-03
16:58:02.0 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c  2008-07-03
16:58:30.0 +0530
@@ -299,6 +299,7 @@ static void __init omap_3430sdp_init(voi
ARRAY_SIZE(sdp3430_spi_board_info));
ads7846_dev_init();
sdp3430_flash_init();
+   twl4030_bci_battery_init();
omap_serial_init();
usb_musb_init();
usb_ehci_init();
Index: linux-omap-2.6/include/asm-arm/arch-omap/board-3430sdp.h
===
--- linux-omap-2.6.orig/include/asm-arm/arch-omap/board-3430sdp.h   
2008-07-03
16:58:02.0 +0530
+++ linux-omap-2.6/include/asm-arm/arch-omap/board-3430sdp.h2008-07-03
16:58:30.0 +0530
@@ -31,6 +31,7 @@

 extern void sdp3430_usb_init(void);
 extern void sdp3430_flash_init(void);
+extern void twl4030_bci_battery_init(void);

 #define DEBUG_BASE 0x0800  /* debug board */

Index: linux-omap-2.6/arch/arm/mach-omap2/bci.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-omap-2.6/arch/arm/mach-omap2/bci.c2008-07-03 16:59:40.0 
+0530
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/arm/mach-omap2/board-3430sdp-bci.c
+ *
+ * TWL4030 BCI platform device setup/initialization
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+
+#if defined(CONFIG_TWL4030_BCI_BATTERY) || \
+   defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
+
+static struct platform_device twl4030_bci_battery_device = {
+   .name   = twl4030-bci-battery,
+   .id = 1,
+   .num_resources  = 0,
+};
+
+void __init twl4030_bci_battery_init(void)
+{
+   (void) platform_device_register(twl4030_bci_battery_device);
+}
+#else
+void __init twl4030_bci_battery_init(void)
+{
+}
+#endif


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


[Resending - PATCH 3/3] Triton BCI driver for OMAP3430 - USB changes

2008-07-03 Thread Madhusudhan Chikkature
From: Madhusudhan Chikkature[EMAIL PROTECTED]

This patch calls the functionality supported by the TWL4030 battery charger
interface driver
to enable/disable battery charging upon cable attach/detach.

Signed-off-by: Madhusudhan Chikkature[EMAIL PROTECTED]
---
 drivers/i2c/chips/twl4030-usb.c |7 +--
 include/linux/i2c/twl4030.h |7 +++
 2 files changed, 12 insertions(+), 2 deletions(-)

Index: linux-omap-2.6/drivers/i2c/chips/twl4030-usb.c
===
--- linux-omap-2.6.orig/drivers/i2c/chips/twl4030-usb.c 2008-07-03
16:09:05.0 +0530
+++ linux-omap-2.6/drivers/i2c/chips/twl4030-usb.c  2008-07-03
17:03:30.0 +0530
@@ -601,10 +601,13 @@ static irqreturn_t twl4030_usb_irq(int i
goto done;
}

-   if (val  USB_PRES_RISING)
+   if (val  USB_PRES_RISING) {
twl4030_phy_resume();
-   else
+   twl4030charger_usb_en(1);
+   } else {
+   twl4030charger_usb_en(0);
twl4030_phy_suspend(0);
+   }

ret = IRQ_HANDLED;

Index: linux-omap-2.6/include/linux/i2c/twl4030.h
===
--- linux-omap-2.6.orig/include/linux/i2c/twl4030.h 2008-07-03
16:09:05.0 +0530
+++ linux-omap-2.6/include/linux/i2c/twl4030.h  2008-07-03 17:03:30.0 
+0530
@@ -127,4 +127,11 @@ int twl4030_set_gpio_edge_ctrl(int gpio,
 int twl4030_set_gpio_debounce(int gpio, int enable);
 int twl4030_free_gpio(int gpio);

+#if defined(CONFIG_TWL4030_BCI_BATTERY) || \
+   defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
+   extern int twl4030charger_usb_en(int enable);
+#else
+   static inline int twl4030charger_usb_en(int enable) { return 0; }
+#endif
+
 #endif /* End of __TWL4030_H */


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


Re: [ PATCH 2/3 ] net:smc911x Modify driver to also work with omap24xx

2008-07-03 Thread Tony Lindgren
* Arun KS [EMAIL PROTECTED] [080626 18:17]:
 On Thu, Jun 26, 2008 at 5:52 PM, Tony Lindgren [EMAIL PROTECTED] wrote:
  Hi,
 
  * Arun KS [EMAIL PROTECTED] [080624 15:14]:
  net:smc911x Modify driver to also work with omap24xx
 
  Few comments below.
 
  Also, can you please send this to the Linux netdev mailing list?
  Also Cc linux-omap list too.
 
  Signed-off-by: Arun KS [EMAIL PROTECTED]
  ---
   drivers/net/Kconfig   |2 +-
   drivers/net/smc911x.h |5 +
   2 files changed, 6 insertions(+), 1 deletions(-)
 
  diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
  index 61ecee7..17d0a9c 100644
  --- a/drivers/net/Kconfig
  +++ b/drivers/net/Kconfig
  @@ -955,7 +955,7 @@ config SMC911X
  tristate SMSC LAN911[5678] support
  select CRC32
  select MII
  -   depends on ARCH_PXA || SH_MAGIC_PANEL_R2 || ARCH_OMAP34XX
  +   depends on ARCH_PXA || SH_MAGIC_PANEL_R2 || ARCH_OMAP34XX || 
  ARCH_OMAP24XX
  help
This is a driver for SMSC's LAN911x series of Ethernet chipsets
including the new LAN9115, LAN9116, LAN9117, and LAN9118.
 
  Maybe have ARCH_OMAP24XX before ARCH_OMAP34XX to be consistent
  how it's done elsewhere.
 
 
  diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
  index dad93a8..0f406a0 100644
  --- a/drivers/net/smc911x.h
  +++ b/drivers/net/smc911x.h
  @@ -47,6 +47,11 @@
 #define SMC_USE_32BIT1
 #define SMC_IRQ_SENSEIRQF_TRIGGER_LOW
 #define SMC_MEM_RESERVED 1
  +#elif defined(CONFIG_ARCH_OMAP24XX)
  +  #define SMC_USE_16BIT0
  +  #define SMC_USE_32BIT1
  +  #define SMC_IRQ_SENSEIRQF_TRIGGER_LOW
  +  #define SMC_MEM_RESERVED 1
 Here i used the tab itself, when this patch is applied it comes pretty fine in
 the code. I checked the patch with checkpatch.pl also. Can you tell me
 what is going wrong?
 
 After code formating issues are resolved i can resend the patch again.

OK, I was just looking the patch. I trust you on the formatting issue :)

Tony

 
 Regards,
 Arun
   #endif
 
  You should probably use tabs here in the new code even if old code
  does not.
 
  Regards,
 
  Tony
 
 
 
  --
  1.5.3.4
 
  From 8b45bfd40aca7d5f89195f95d668bae78e2dbba9 Mon Sep 17 00:00:00 2001
  From: Arun KS [EMAIL PROTECTED]
  Date: Tue, 24 Jun 2008 17:33:08 +0530
  Subject: [PATCH] net:smc911x Modify driver to also work with omap24xx
 
  net:smc911x Modify driver to also work with omap24xx
 
  Signed-off-by: Arun KS [EMAIL PROTECTED]
  ---
   drivers/net/Kconfig   |2 +-
   drivers/net/smc911x.h |5 +
   2 files changed, 6 insertions(+), 1 deletions(-)
 
  diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
  index 61ecee7..17d0a9c 100644
  --- a/drivers/net/Kconfig
  +++ b/drivers/net/Kconfig
  @@ -955,7 +955,7 @@ config SMC911X
tristate SMSC LAN911[5678] support
select CRC32
select MII
  - depends on ARCH_PXA || SH_MAGIC_PANEL_R2 || ARCH_OMAP34XX
  + depends on ARCH_PXA || SH_MAGIC_PANEL_R2 || ARCH_OMAP34XX || 
  ARCH_OMAP24XX
help
  This is a driver for SMSC's LAN911x series of Ethernet chipsets
  including the new LAN9115, LAN9116, LAN9117, and LAN9118.
  diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
  index dad93a8..0f406a0 100644
  --- a/drivers/net/smc911x.h
  +++ b/drivers/net/smc911x.h
  @@ -47,6 +47,11 @@
 #define SMC_USE_32BIT  1
 #define SMC_IRQ_SENSE  IRQF_TRIGGER_LOW
 #define SMC_MEM_RESERVED   1
  +#elif defined(CONFIG_ARCH_OMAP24XX)
  +  #define SMC_USE_16BIT  0
  +  #define SMC_USE_32BIT  1
  +  #define SMC_IRQ_SENSE  IRQF_TRIGGER_LOW
  +  #define SMC_MEM_RESERVED   1
   #endif
 
 
  --
  1.5.3.4
 
 
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] omap: hsmmc: Avoid NULL pointer dereference

2008-07-03 Thread Tony Lindgren
* Felipe Balbi [EMAIL PROTECTED] [080630 17:18]:
 Try if pdata provides a cleanup function pointers. For
 boards which don't provide it, driver will oops in
 omap_remove.

Pushing today.

Tony

 Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
 ---
  drivers/mmc/host/omap_hsmmc.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
 index 467f146..4dfa8dd 100644
 --- a/drivers/mmc/host/omap_hsmmc.c
 +++ b/drivers/mmc/host/omap_hsmmc.c
 @@ -887,7 +887,8 @@ static int omap_mmc_remove(struct platform_device *pdev)
  
   platform_set_drvdata(pdev, NULL);
   if (host) {
 - host-pdata-cleanup(pdev-dev);
 + if (host-pdata-cleanup)
 + host-pdata-cleanup(pdev-dev);
   free_irq(host-irq, host);
   if (mmc_slot(host).card_detect_irq)
   free_irq(mmc_slot(host).card_detect_irq, host);
 -- 
 1.5.6.49.g112db
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


On vacation in July

2008-07-03 Thread Tony Lindgren
Hi all,

Just FYI, I'll be mostly offline and on vacation during July.

I've pushed some patches today.. There are still pending patches
on the mailing list that have to wait until the beginning of August.

Cheers,

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


Re: [PATCH] OMAP: Store switch state for OUTPUT gpio-switches

2008-07-03 Thread Tony Lindgren
* Mikko Ylinen [EMAIL PROTECTED] [080630 16:35]:

Pushing today.

Tony

 Signed-off-by: Mikko Ylinen [EMAIL PROTECTED]
 ---
  arch/arm/plat-omap/gpio-switch.c |5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/plat-omap/gpio-switch.c 
 b/arch/arm/plat-omap/gpio-switch.c
 index cd96c00..7a61d0e 100644
 --- a/arch/arm/plat-omap/gpio-switch.c
 +++ b/arch/arm/plat-omap/gpio-switch.c
 @@ -131,11 +131,12 @@ static ssize_t gpio_sw_state_store(struct device *dev,
  
   str = get_sw_str(sw);
   if (strcmp(state, str[0]) == 0)
 - enable = 0;
 + sw-state = enable = 0;
   else if (strcmp(state, str[1]) == 0)
 - enable = 1;
 + sw-state = enable = 1;
   else
   return -EINVAL;
 +
   if (sw-flags  OMAP_GPIO_SWITCH_FLAG_INVERTED)
   enable = !enable;
   omap_set_gpio_dataout(sw-gpio, enable);
 -- 
 1.5.5.2
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] driver: irda support 3430

2008-07-03 Thread Tony Lindgren
Hi,

* Girish. S. G. [EMAIL PROTECTED] [080703 11:10]:
 Irda driver changes to support on 3430
 
 Signed-off-by: Girish S G [EMAIL PROTECTED]
 ---
  drivers/net/irda/omap-ir.c |   14 +++---
  1 files changed, 11 insertions(+), 3 deletions(-)
 
 Index: linux-omap-2.6_today/drivers/net/irda/omap-ir.c
 ===
 --- linux-omap-2.6_today.orig/drivers/net/irda/omap-ir.c  2008-07-03
 10:33:57.0 +0530
 +++ linux-omap-2.6_today/drivers/net/irda/omap-ir.c   2008-07-03
 10:35:30.0 +0530
 @@ -217,7 +217,7 @@
   struct net_device *dev = data;
   struct omap_irda *omap_ir = netdev_priv(dev);
 
 - /*Stop DMA controller */
 + /* Stop DMA controller */
   omap_stop_dma(omap_ir-tx_dma_channel);
  }
 
 @@ -378,8 +378,12 @@
 
   skb_reserve(skb, 1);
 
 - w = omap_get_dma_dst_pos(omap_ir-rx_dma_channel) -
 - omap_ir-rx_buf_dma_phys;
 + w = OMAP_DMA4_CDAC(omap_ir-rx_dma_channel);
 +
 + if (cpu_is_omap16xx())
 + w -= OMAP1_DMA_CDSA_L(omap_ir-rx_dma_channel);
 + if (cpu_is_omap24xx() || cpu_is_omap34xx())
 + w -= OMAP_DMA4_CDSA(omap_ir-rx_dma_channel);
 
   if (!IS_FIR(omap_ir))
   /* Copy DMA buffer to skb */

Let's not tinker with the DMA registers again directly just as I
thought I got all that clean-up a bit! :)

Can you rather use the exported functions? If something is missing,
let's add it. But in the above case omap_set_dma_dest_params() and
omap_set_dma_src_params() should work I believe.

Regards,

Tony


 @@ -604,6 +608,8 @@
  err_irlap:
   omap_ir-open = 0;
   omap_irda_shutdown(omap_ir);
 + if (omap_ir-pdata-select_irda)
 + omap_ir-pdata-select_irda(omap_ir-dev, ~IR_SEL);
  err_startup:
   dma_free_coherent(NULL, IRDA_SIR_MAX_FRAME,
   omap_ir-tx_buf_dma_virt, omap_ir-tx_buf_dma_phys);
 @@ -636,6 +642,8 @@
   omap_ir-tx_buf_dma_phys);
 
   omap_irda_shutdown(omap_ir);
 + if (omap_ir-pdata-select_irda)
 + omap_ir-pdata-select_irda(omap_ir-dev, ~IR_SEL);
 
   /* Stop IrLAP */
   if (omap_ir-irlap) {
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RESEND][PATCH]Separate out 3430 LCD panel support from 2430 file

2008-07-03 Thread Tony Lindgren
* [EMAIL PROTECTED] [EMAIL PROTECTED] [080702 15:25]:
 From: Iqbal Shareef [EMAIL PROTECTED]
 
 Separate out 3430 LCD panel support from 2430 SDP.
 
 Currently the support for the LCD on 3430SDP is added in the lcd_2430sdp.c
 file. This patch separates it out to a new file.

Pushing today.

Tony


 Signed-off-by: Iqbal Shareef  [EMAIL PROTECTED]
 
 ---
  arch/arm/mach-omap2/board-3430sdp.c |2 +-
  drivers/video/omap/Makefile |2 +-
  drivers/video/omap/lcd_3430sdp.c|  162 
 +++
  3 files changed, 164 insertions(+), 2 deletions(-)
  create mode 100644 drivers/video/omap/lcd_3430sdp.c
 
 diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
 b/arch/arm/mach-omap2/board-3430sdp.c
 index f6cd08b..7a216cc 100644
 --- a/arch/arm/mach-omap2/board-3430sdp.c
 +++ b/arch/arm/mach-omap2/board-3430sdp.c
 @@ -204,7 +204,7 @@ static struct spi_board_info sdp3430_spi_board_info[] 
 __initdata = {
  };
  
  static struct platform_device sdp3430_lcd_device = {
 - .name   = sdp2430_lcd,
 + .name   = sdp3430_lcd,
   .id = -1,
  };
  
 diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile
 index fe7ee5d..a72a2d9 100644
 --- a/drivers/video/omap/Makefile
 +++ b/drivers/video/omap/Makefile
 @@ -30,7 +30,7 @@ objs-y$(CONFIG_MACH_SX1) += lcd_sx1.o
  
  objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o
  objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o
 -objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_2430sdp.o
 +objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_3430sdp.o
  objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o
  objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o
  objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
 diff --git a/drivers/video/omap/lcd_3430sdp.c 
 b/drivers/video/omap/lcd_3430sdp.c
 new file mode 100644
 index 000..20ac0e5
 --- /dev/null
 +++ b/drivers/video/omap/lcd_3430sdp.c
 @@ -0,0 +1,162 @@
 +/*
 + * LCD panel support for the TI 3430SDP board
 + *
 + * Copyright (C) 2008 Texas Instruments
 + * Author: Iqbal Shareef [EMAIL PROTECTED]
 + *
 + * Derived from drivers/video/omap/lcd_2430sdp.c
 + * Copyright (C) 2007 MontaVista
 + * Author: Hunyue Yau [EMAIL PROTECTED]
 + *
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms of the GNU General Public License as published by the
 + * Free Software Foundation; either version 2 of the License, or (at your
 + * option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License along
 + * with this program; if not, write to the Free Software Foundation, Inc.,
 + * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 + */
 +
 +#include linux/module.h
 +#include linux/platform_device.h
 +#include linux/i2c/twl4030.h
 +
 +#include asm/arch/gpio.h
 +#include asm/arch/omapfb.h
 +
 +#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
 +#define SDP3430_LCD_PANEL_ENABLE_GPIO5
 +
 +static unsigned backlight_gpio;
 +static unsigned enable_gpio;
 +
 +#define LCD_PIXCLOCK_MAX 167000
 +#define ENABLE_VAUX2_DEDICATED   0x03
 +#define ENABLE_VAUX2_DEV_GRP 0x20
 +#define ENABLE_VAUX3_DEDICATED   0x05
 +#define ENABLE_VAUX3_DEV_GRP 0xE0
 +
 +static int sdp3430_panel_init(struct lcd_panel *panel,
 + struct omapfb_device *fbdev)
 +{
 + enable_gpio= SDP3430_LCD_PANEL_ENABLE_GPIO;
 + backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO;
 +
 + omap_request_gpio(enable_gpio); /* LCD panel */
 + omap_request_gpio(backlight_gpio);  /* LCD backlight */
 + omap_set_gpio_direction(enable_gpio, 0);/* output */
 + omap_set_gpio_direction(backlight_gpio, 0); /* output */
 +
 + return 0;
 +}
 +
 +static void sdp3430_panel_cleanup(struct lcd_panel *panel)
 +{
 + omap_free_gpio(backlight_gpio);
 + omap_free_gpio(enable_gpio);
 +}
 +
 +static int sdp3430_panel_enable(struct lcd_panel *panel)
 +{
 + omap_set_gpio_dataout(enable_gpio, 1);
 + omap_set_gpio_dataout(backlight_gpio, 1);
 +
 + if (0 != twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 
 ENABLE_VAUX3_DEDICATED,
 + TWL4030_VAUX3_DEDICATED))
 + return -EIO;
 + if (0 != twl4030_i2c_write_u8(PM_RECEIVER, ENABLE_VAUX3_DEV_GRP,
 + TWL4030_VAUX3_DEV_GRP))
 + return -EIO;
 +
 + return 0;
 +}
 +
 +static void sdp3430_panel_disable(struct lcd_panel *panel)
 +{
 + omap_set_gpio_dataout(enable_gpio, 0);
 + omap_set_gpio_dataout(backlight_gpio, 0);
 +}
 +
 +static unsigned long 

Re: [PATCH 1/3] OMAP3: EVM: KEYPAD: Add twl4030 keypad driver support

2008-07-03 Thread Tony Lindgren
* Miguel Aguilar [EMAIL PROTECTED] [080625 23:17]:
 Add twl4030 keypad driver support to OMAP3 EVM

 Signed-off-by: Miguel Angel Aguilar [EMAIL PROTECTED] ---
 arch/arm/mach-omap2/board-omap3evm.c   |   38 
 1 files changed, 38 insertions(+), 0 deletions(-)

 diff --git a/reference_kernel/arch/arm/mach-omap2/board-omap3evm.c 
 b/linux-2.6.26/arch/arm/mach-omap2/board-omap3evm.c
 index d8109ae..0061512 100644
 --- a/reference_kernel/arch/arm/mach-omap2/board-omap3evm.c
 +++ b/linux-2.6.26/arch/arm/mach-omap2/board-omap3evm.c

Pushing, I've fixed the patch path above to work with patch -p1.

Tony


 @@ -19,6 +19,7 @@
 #include linux/err.h
 #include linux/clk.h
 #include linux/io.h
 +#include linux/input.h
 #include linux/spi/spi.h
 #include linux/spi/ads7846.h

 @@ -28,6 +29,7 @@
 #include asm/mach/map.h

 #include asm/arch/gpio.h
 +#include asm/arch/keypad.h
 #include asm/arch/board.h
 #include asm/arch/hsmmc.h
 #include asm/arch/usb-musb.h
 @@ -149,6 +151,41 @@ struct spi_board_info omap3evm_spi_board_info[] = {
   },
 };

 +static int omap3evm_keymap[] = {
 + KEY(0, 0, KEY_LEFT),
 + KEY(0, 1, KEY_RIGHT),
 + KEY(0, 2, KEY_A),
 + KEY(0, 3, KEY_B),
 + KEY(1, 0, KEY_DOWN),
 + KEY(1, 1, KEY_UP),
 + KEY(1, 2, KEY_E),
 + KEY(1, 3, KEY_F),
 + KEY(2, 0, KEY_ENTER),
 + KEY(2, 1, KEY_I),
 + KEY(2, 2, KEY_J),
 + KEY(2, 3, KEY_K),
 + KEY(3, 0, KEY_M),
 + KEY(3, 1, KEY_N),
 + KEY(3, 2, KEY_O),
 + KEY(3, 3, KEY_P)
 +};
 +
 +static struct omap_kp_platform_data omap3evm_kp_data = {
 + .rows   = 4,
 + .cols   = 4,
 + .keymap = omap3evm_keymap,
 + .keymapsize = ARRAY_SIZE(omap3evm_keymap),
 + .rep= 1,
 +};
 +
 +static struct platform_device omap3evm_kp_device = {
 + .name   = omap_twl4030keypad,
 + .id = -1,
 + .dev= {
 + .platform_data = omap3evm_kp_data,
 + },
 +};
 +
 static void __init omap3_evm_init_irq(void)
 {
   omap2_init_common_hw();
 @@ -165,6 +202,7 @@ static struct omap_board_config_kernel omap3_evm_config[] 
 __initdata = {

 static struct platform_device *omap3_evm_devices[] __initdata = {
   omap3_evm_lcd_device,
 + omap3evm_kp_device,
 #ifdef CONFIG_RTC_DRV_TWL4030
   omap3_evm_twl4030rtc_device,
 #endif
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] OMAP3: EVM: KEYPAD: Fix Kconfig dependency

2008-07-03 Thread Tony Lindgren
* Miguel Aguilar [EMAIL PROTECTED] [080625 23:18]:
 Add twl4030 keypad driver support to OMAP3 EVM

Pushing today, this one needed fixing too for the path.

Tony

 Signed-off-by: Miguel Angel Aguilar [EMAIL PROTECTED] ---
 drivers/input/keyboard/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

 diff --git a/reference_kernel/drivers/input/keyboard/Kconfig 
 b/linux-2.6.26/drivers/input/keyboard/Kconfig
 index 0f96a30..cf86a7b 100644
 --- a/reference_kernel/drivers/input/keyboard/Kconfig
 +++ b/linux-2.6.26/drivers/input/keyboard/Kconfig
 @@ -261,7 +261,7 @@ config KEYBOARD_OMAP

 config KEYBOARD_TWL4030
   tristate TI TWL4030 keypad support
 - depends on TWL4030_CORE  (MACH_OMAP_2430SDP || MACH_OMAP_3430SDP)
 + depends on TWL4030_CORE  (MACH_OMAP_2430SDP || MACH_OMAP_3430SDP || 
 MACH_OMAP3EVM)
   help
 Say Y here if you want to use the OMAP TWL4030 keypad.
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] CBUS: A workaround for ADC S/H HW bug: always keep ch 8 selected when S/H is used

2008-07-03 Thread Tony Lindgren
* Mikko Ylinen [EMAIL PROTECTED] [080630 16:34]:

Pushing today.

Tony

 Signed-off-by: Mikko Ylinen [EMAIL PROTECTED]
 ---
  drivers/cbus/retu.c |   12 
  drivers/cbus/retu.h |1 +
  2 files changed, 13 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/cbus/retu.c b/drivers/cbus/retu.c
 index 715b88d..4849841 100644
 --- a/drivers/cbus/retu.c
 +++ b/drivers/cbus/retu.c
 @@ -114,9 +114,21 @@ int retu_read_adc(int channel)
   return -EINVAL;
  
   spin_lock_irqsave(retu_lock, flags);
 +
 + if ((channel == 8)  retu_is_vilma) {
 + int scr = retu_read_reg(RETU_REG_ADCSCR);
 + int ch = (retu_read_reg(RETU_REG_ADCR)  10)  0xf;
 + if (((scr  0xff) != 0)  (ch != 8))
 + retu_write_reg (RETU_REG_ADCSCR, (scr  ~0xff));
 + }
 +
   /* Select the channel and read result */
   retu_write_reg(RETU_REG_ADCR, channel  10);
   res = retu_read_reg(RETU_REG_ADCR)  0x3ff;
 +
 + if (retu_is_vilma)
 + retu_write_reg(RETU_REG_ADCR, (1  13));
 +
   /* Unlock retu */
   spin_unlock_irqrestore(retu_lock, flags);
  
 diff --git a/drivers/cbus/retu.h b/drivers/cbus/retu.h
 index 49f23e6..c9e044c 100644
 --- a/drivers/cbus/retu.h
 +++ b/drivers/cbus/retu.h
 @@ -34,6 +34,7 @@
  #define RETU_REG_RTCHMAR 0x05/* RTC hours and minutes alarm and time 
 set register */
  #define RETU_REG_RTCCALR 0x06/* RTC calibration register */
  #define RETU_REG_ADCR0x08/* ADC result */
 +#define RETU_REG_ADCSCR  0x09/* ADC sample ctrl */
  #define RETU_REG_CC1 0x0d/* Common control register 1 */
  #define RETU_REG_CC2 0x0e/* Common control register 2 */
  #define RETU_REG_CTRL_CLR0x0f/* Regulator clear register */
 -- 
 1.5.5.2
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] OMAP: DISPC: Fix to disable also interface clocks. 2nd.

2008-07-03 Thread Tony Lindgren
* Jouni Hogander [EMAIL PROTECTED] [080701 12:39]:
 Leaving interface clocks enabled causes dss pwrdm to stay in active
 state when mpu is in active state. This fix puts dss to sleep state
 when it is not needed.

Pushing today.

Tony

 
 Signed-off-by: Jouni Hogander [EMAIL PROTECTED]
 ---
  drivers/video/omap/dispc.c |   16 
  1 files changed, 4 insertions(+), 12 deletions(-)
 
 diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
 index 6aff476..d82588c 100644
 --- a/drivers/video/omap/dispc.c
 +++ b/drivers/video/omap/dispc.c
 @@ -914,18 +914,13 @@ static void put_dss_clocks(void)
  
  static void enable_lcd_clocks(int enable)
  {
 - if (enable)
 + if (enable) {
 + clk_enable(dispc.dss_ick);
   clk_enable(dispc.dss1_fck);
 - else
 + } else {
   clk_disable(dispc.dss1_fck);
 -}
 -
 -static void enable_interface_clocks(int enable)
 -{
 - if (enable)
 - clk_enable(dispc.dss_ick);
 - else
   clk_disable(dispc.dss_ick);
 + }
  }
  
  static void enable_digit_clocks(int enable)
 @@ -1361,7 +1356,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, 
 int ext_mode,
   if ((r = get_dss_clocks())  0)
   return r;
  
 - enable_interface_clocks(1);
   enable_lcd_clocks(1);
  
  #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
 @@ -1465,7 +1459,6 @@ fail2:
   free_irq(INT_24XX_DSS_IRQ, fbdev);
  fail1:
   enable_lcd_clocks(0);
 - enable_interface_clocks(0);
   put_dss_clocks();
  
   return r;
 @@ -1482,7 +1475,6 @@ static void omap_dispc_cleanup(void)
   cleanup_fbmem();
   free_palette_ram();
   free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
 - enable_interface_clocks(0);
   put_dss_clocks();
  }
  
 -- 
 1.5.5
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] OMAP: DISPC: Fix to disable also interface clocks. 2nd.

2008-07-03 Thread Tony Lindgren
* Tony Lindgren [EMAIL PROTECTED] [080703 14:03]:
 * Jouni Hogander [EMAIL PROTECTED] [080701 12:39]:
  Leaving interface clocks enabled causes dss pwrdm to stay in active
  state when mpu is in active state. This fix puts dss to sleep state
  when it is not needed.
 
 Pushing today.

And then reverted, this one seems to break framebuffer at least on 24xx.

 
 Tony
 
  
  Signed-off-by: Jouni Hogander [EMAIL PROTECTED]
  ---
   drivers/video/omap/dispc.c |   16 
   1 files changed, 4 insertions(+), 12 deletions(-)
  
  diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
  index 6aff476..d82588c 100644
  --- a/drivers/video/omap/dispc.c
  +++ b/drivers/video/omap/dispc.c
  @@ -914,18 +914,13 @@ static void put_dss_clocks(void)
   
   static void enable_lcd_clocks(int enable)
   {
  -   if (enable)
  +   if (enable) {
  +   clk_enable(dispc.dss_ick);
  clk_enable(dispc.dss1_fck);
  -   else
  +   } else {
  clk_disable(dispc.dss1_fck);
  -}
  -
  -static void enable_interface_clocks(int enable)
  -{
  -   if (enable)
  -   clk_enable(dispc.dss_ick);
  -   else
  clk_disable(dispc.dss_ick);
  +   }
   }
   
   static void enable_digit_clocks(int enable)
  @@ -1361,7 +1356,6 @@ static int omap_dispc_init(struct omapfb_device 
  *fbdev, int ext_mode,
  if ((r = get_dss_clocks())  0)
  return r;
   
  -   enable_interface_clocks(1);
  enable_lcd_clocks(1);
   
   #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
  @@ -1465,7 +1459,6 @@ fail2:
  free_irq(INT_24XX_DSS_IRQ, fbdev);
   fail1:
  enable_lcd_clocks(0);
  -   enable_interface_clocks(0);
  put_dss_clocks();
   
  return r;
  @@ -1482,7 +1475,6 @@ static void omap_dispc_cleanup(void)
  cleanup_fbmem();
  free_palette_ram();
  free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
  -   enable_interface_clocks(0);
  put_dss_clocks();
   }
   
  -- 
  1.5.5
  
  --
  To unsubscribe from this list: send the line unsubscribe linux-omap in
  the body of a message to [EMAIL PROTECTED]
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [resend][PATCH 0/3] Adding ethernet support on omap2evm

2008-07-03 Thread Tony Lindgren
* Arun KS [EMAIL PROTECTED] [080630 18:04]:
 Hi all,
 
 The following set of patches add ethernet support for omap2evm
 I have incorporated the comments form Tony and Felipe.
 
 *  0001-OMAP2EVM-Adding-ethernet-support.patch
This patch modifies the board files for supporting smc9115
 *  0002-net-smc911x-Modify-driver-to-also-work-with-omap24xx.patch
This patch modifies the driver files to add support for
 omap24xx platforms
 I will be sent this patch to linux-netdev also.
 *  0003-Added-ethernet-driver-support-in-defconfig.patch

Pushing this series today to linux-omap. Please remember to follow up
on the smc911x changes on the netdev list!

Regards,

Tony


 
 Best Regards,
 Arun KS
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Resending - PATCH 1/3] Triton BCI driver device setup for OMAP3430

2008-07-03 Thread Felipe Balbi


On Thu, 3 Jul 2008 17:35:50 +0530 (IST), Madhusudhan Chikkature
[EMAIL PROTECTED] wrote:

 Index: linux-omap-2.6/arch/arm/mach-omap2/bci.c
 ===
 --- /dev/null 1970-01-01 00:00:00.0 +
 +++ linux-omap-2.6/arch/arm/mach-omap2/bci.c  2008-07-03
16:59:40.0
 +0530
 @@ -0,0 +1,34 @@
 +/*
 + * linux/arch/arm/mach-omap2/board-3430sdp-bci.c

just fix this name please.

Style only.


 +
 +static struct platform_device twl4030_bci_battery_device = {
 + .name   = twl4030-bci-battery,
 + .id = 1,

use -1. There will be no other twl4030-bci-battery in the system :-)

-- 
Best Regards,

Felipe Balbi
http://blog.felipebalbi.com
[EMAIL PROTECTED]

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


Git pull request for omap patches for post 2.6.26

2008-07-03 Thread Tony Lindgren
Russell,

Please pull the omap patches for post-2.6.26 from:

git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git 
omap2-upstream

The patches in question have been posted earlier to linux-arm-kernel
as three separate sets:

[PATCH 00/21] Omap upstream patches for post 2.6.26 [1]
[PATCH 00/12] Omap2 clock patches for post 2.6.26 [2]
[PATCH 00/16] Omap2 patches for post 2.6.26 [3]

These patches can be also viewed at [4][5][6].

As the earlier omap fixes have now been merged, I've rebased
these patches on top of v2.6.26-rc8-204-gc461a97.

Regards,

Tony


[1]
http://lists.arm.linux.org.uk/lurker/message/20080607.014741.c812.en.html
http://lists.arm.linux.org.uk/lurker/message/20080607.013033.9ad5054e.en.html
...

[2]
http://lists.arm.linux.org.uk/lurker/message/20080607.015122.ee025150.en.html
http://lists.arm.linux.org.uk/lurker/message/20080607.013506.bdb3222f.en.html
...

[3]
http://lists.arm.linux.org.uk/lurker/message/20080607.014741.c812.en.html
http://lists.arm.linux.org.uk/lurker/message/20080607.014742.746c44a3.en.html
http://lists.arm.linux.org.uk/lurker/message/20080607.021228.06b0242e.en.html#linux-arm-kernel
...

[4]
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=097c584cd48844d9ef8402bdc6ab49e7e2135f31

[5]
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=5114490e93ae9e445365bd9ff9e6bd96ae816307

[6]
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=457dfc3bf3ac4ac1f6a5ab6651b52caed3f8d4da
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


34xx off-mode support fixes

2008-07-03 Thread Tero Kristo
Hi,

This patch set contains some experimental fixes for the cpu-idle support from
Rajendra Nayak. With this patch set, all power domains enter OFF mode and
recover from it, at least while using suspend and/or dynamic idle. If you
are using these patches, you should disable CPU_IDLE support from kernel
config as I am not certain it works with this patch set yet. The last patch
contains some trial fix to cpuidle code, so it might work also if you are
lucky enough.

-Tero


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


Re: [PATCH 1/6] 34XX: PM: Workaround to reset all wkdeps

2008-07-03 Thread Tony Lindgren
* Jouni Hogander [EMAIL PROTECTED] [080630 11:53]:
 This workaround is needed until powerdomain code resets wkdeps.

Pushing today.

Tony


 Signed-off-by: Jouni Hogander [EMAIL PROTECTED]
 ---
  arch/arm/mach-omap2/pm34xx.c |   20 ++--
  1 files changed, 18 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
 index 202c269..449e7b5 100644
 --- a/arch/arm/mach-omap2/pm34xx.c
 +++ b/arch/arm/mach-omap2/pm34xx.c
 @@ -332,6 +332,20 @@ static struct platform_suspend_ops omap_pm_ops = {
  
  static void __init prcm_setup_regs(void)
  {
 + /* XXX Reset all wkdeps. This should be done when initializing
 +  * powerdomains */
 + prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
 + prm_write_mod_reg(0, MPU_MOD, PM_WKDEP);
 + prm_write_mod_reg(0, OMAP3430_DSS_MOD, PM_WKDEP);
 + prm_write_mod_reg(0, OMAP3430_NEON_MOD, PM_WKDEP);
 + prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP);
 + prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP);
 + if (is_sil_rev_greater_than(OMAP3430_REV_ES1_0)) {
 + prm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, PM_WKDEP);
 + prm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
 + } else
 + prm_write_mod_reg(0, GFX_MOD, PM_WKDEP);
 +
   /* setup wakup source */
   prm_write_mod_reg(OMAP3430_EN_IO | OMAP3430_EN_GPIO1 | OMAP3430_EN_GPT1,
 WKUP_MOD, PM_WKEN);
 @@ -371,6 +385,10 @@ int __init omap3_pm_init(void)
  
   printk(KERN_ERR Power Management for TI OMAP3.\n);
  
 + /* XXX prcm_setup_regs needs to be before enabling hw
 +  * supervised mode for powerdomains */
 + prcm_setup_regs();
 +
   ret = request_irq(INT_34XX_PRCM_MPU_IRQ,
 (irq_handler_t)prcm_interrupt_handler,
 IRQF_DISABLED, prcm, NULL);
 @@ -397,8 +415,6 @@ int __init omap3_pm_init(void)
  
   suspend_set_ops(omap_pm_ops);
  
 - prcm_setup_regs();
 -
   pm_idle = omap3_pm_idle;
  
  err1:
 -- 
 1.5.5
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP2EVM: add LCD panel support

2008-07-03 Thread arun c
omap2evm LCD supports VGA and QVGA resolution, by default its in VGA mode.

Signed-off-by: Arun C [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-omap2evm.c |   15 +++-
 drivers/video/omap/Makefile  |1 +
 drivers/video/omap/lcd_omap2evm.c|  195 ++
 3 files changed, 209 insertions(+), 2 deletions(-)
 create mode 100644 drivers/video/omap/lcd_omap2evm.c

diff --git a/arch/arm/mach-omap2/board-omap2evm.c
b/arch/arm/mach-omap2/board-omap2evm.c
index bcdf4a6..db1c4cb 100644
--- a/arch/arm/mach-omap2/board-omap2evm.c
+++ b/arch/arm/mach-omap2/board-omap2evm.c
@@ -62,6 +62,15 @@ static inline void __init omap2evm_init_smc911x(void)

 }

+static struct platform_device omap2_evm_lcd_device = {
+   .name   = omap2evm_lcd,
+   .id = -1,
+};
+
+static struct omap_lcd_config omap2_evm_lcd_config __initdata = {
+   .ctrl_name  = internal,
+};
+
 static void __init omap2_evm_init_irq(void)
 {
omap2_init_common_hw();
@@ -75,7 +84,8 @@ static struct omap_uart_config omap2_evm_uart_config
__initdata = {
 };

 static struct omap_board_config_kernel omap2_evm_config[] __initdata = {
-   {OMAP_TAG_UART, omap2_evm_uart_config},
+   { OMAP_TAG_UART,omap2_evm_uart_config },
+   { OMAP_TAG_LCD, omap2_evm_lcd_config },
 };

 static int __init omap2_evm_i2c_init(void)
@@ -90,7 +100,8 @@ static int __init omap2_evm_i2c_init(void)
 }

 static struct platform_device *omap2_evm_devices[] __initdata = {
-omap2evm_smc911x_device,
+   omap2_evm_lcd_device,
+   omap2evm_smc911x_device,
 };

 static void __init omap2_evm_init(void)
diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile
index a72a2d9..e234d5f 100644
--- a/drivers/video/omap/Makefile
+++ b/drivers/video/omap/Makefile
@@ -30,6 +30,7 @@ objs-y$(CONFIG_MACH_SX1) += lcd_sx1.o

 objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o
 objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o
+objs-y$(CONFIG_MACH_OMAP2EVM) += lcd_omap2evm.o
 objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_3430sdp.o
 objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o
 objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o
diff --git a/drivers/video/omap/lcd_omap2evm.c
b/drivers/video/omap/lcd_omap2evm.c
new file mode 100644
index 000..d834640
--- /dev/null
+++ b/drivers/video/omap/lcd_omap2evm.c
@@ -0,0 +1,195 @@
+/*
+ * LCD panel support for the MISTRAL OMAP2EVM board
+ *
+ * Author: Arun C [EMAIL PROTECTED]
+ *
+ * Derived from drivers/video/omap/lcd_omap3evm.c
+ * Derived from drivers/video/omap/lcd-apollon.c
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/i2c/twl4030.h
+
+#include asm/arch/gpio.h
+#include asm/arch/mux.h
+#include asm/arch/omapfb.h
+#include asm/mach-types.h
+
+#define LCD_PANEL_ENABLE_GPIO  154
+#define LCD_PANEL_LR   128
+#define LCD_PANEL_UD   129
+#define LCD_PANEL_INI  152
+#define LCD_PANEL_QVGA 148
+#define LCD_PANEL_RESB 153
+
+#define LCD_XRES   480
+#define LCD_YRES   640
+#define LCD_PIXCLOCK   2 /* in kHz */
+
+#define TWL_LED_LEDEN  0x00
+#define TWL_PWMA_PWMAON0x00
+#define TWL_PWMA_PWMAOFF   0x01
+
+static unsigned int bklight_level;
+
+static int omap2evm_panel_init(struct lcd_panel *panel,
+   struct omapfb_device *fbdev)
+{
+   omap_request_gpio(LCD_PANEL_ENABLE_GPIO);
+   omap_request_gpio(LCD_PANEL_LR);
+   omap_request_gpio(LCD_PANEL_UD);
+   omap_request_gpio(LCD_PANEL_INI);
+   omap_request_gpio(LCD_PANEL_QVGA);
+   omap_request_gpio(LCD_PANEL_RESB);
+
+   omap_set_gpio_direction(LCD_PANEL_ENABLE_GPIO, 0);
+   omap_set_gpio_direction(LCD_PANEL_LR, 0);
+   omap_set_gpio_direction(LCD_PANEL_UD, 0);
+   omap_set_gpio_direction(LCD_PANEL_INI, 0);
+   omap_set_gpio_direction(LCD_PANEL_QVGA, 0);
+   omap_set_gpio_direction(LCD_PANEL_RESB, 0);
+
+   omap_set_gpio_dataout(LCD_PANEL_RESB, 1);
+   omap_set_gpio_dataout(LCD_PANEL_INI, 1);
+   omap_set_gpio_dataout(LCD_PANEL_QVGA, 0);
+   omap_set_gpio_dataout(LCD_PANEL_LR, 1);
+   omap_set_gpio_dataout(LCD_PANEL_UD, 1);
+
+   

Re: [PATCH] OMAP2/3 PM: Add OMAP PM no-op layer

2008-07-03 Thread Paul Walmsley
Hello Ramesh,

On Thu, 3 Jul 2008, Ramesh Gupta G wrote:

  Perhaps something similar to an OMAP PM function
  omap_pm_dsp_get_opp_table() that DSPBridge could call on startup?
 
 Can you please provide tentative dates for the patches available with above
 function?

DSPBridge already has all of that OPP/frequency information inside its 
code, so that's what you should use until that function becomes available.


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] twl4030-madc: Fix arbitrarily initialized function pointer

2008-07-03 Thread Viktor Rosendahl

 
  +   req.func_cb = NULL;
 
 maybe below is a better patch:
 
 diff --git a/drivers/i2c/chips/twl4030-madc.c
 b/drivers/i2c/chips/twl4030-madc.c
 index 72b126b..6d8915e 100644
 --- a/drivers/i2c/chips/twl4030-madc.c
 +++ b/drivers/i2c/chips/twl4030-madc.c
 @@ -360,7 +360,7 @@ static int twl4030_madc_ioctl(struct inode *inode,
 struct file *filp,
  
 switch (cmd) {
 case TWL4030_MADC_IOCX_ADC_RAW_READ: {
 -   struct twl4030_madc_request req;
 +   static struct twl4030_madc_request req;
 if (par.channel = TWL4030_MADC_MAX_CHANNELS)
 return -EINVAL;

I don't like this idea because:

- It's fragile. This struct, which is not a const, gets initialized only
once but we are still passing a pointer to it, expecting that a fairly
complex function will not modify it. This assertion is probably true
today but makes it easier for somebody to create a bug in the future.

- You introduce another shared datum and it is only protected by the BKL
in fs/ioctl.c:vfs_ioctl().

- I didn't see any argument why this variable should be static. Making
local variables static just to get cheap zero initialization is a weird
thing to do IMO.

best regards,

Viktor


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


[Resending - PATCH 1/3] Triton BCI driver device setup for OMAP3430

2008-07-03 Thread Madhusudhan Chikkature
Hi Tony,

I fixed couple of minor comments from Filipe.

Regards,
Madhu



From: Madhusudhan Chikkature[EMAIL PROTECTED]

Device setup/initialization for the Triton battery charger interface driver for
the OMAP3430 SDP.

Signed-off-by: Madhusudhan Chikkature[EMAIL PROTECTED]
---
 arch/arm/mach-omap2/Makefile  |3 +-
 arch/arm/mach-omap2/bci.c |   34 ++
 arch/arm/mach-omap2/board-3430sdp.c   |1
 include/asm-arm/arch-omap/board-3430sdp.h |1
 4 files changed, 38 insertions(+), 1 deletion(-)

Index: linux-omap-2.6/arch/arm/mach-omap2/Makefile
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/Makefile2008-07-03
16:58:02.0 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/Makefile 2008-07-03 16:58:30.0
+0530
@@ -47,7 +47,8 @@ obj-$(CONFIG_MACH_OMAP_3430SDP)   += boar
   hsmmc.o \
   usb-musb.o \
   usb-ehci.o \
-  board-3430sdp-flash.o
+  board-3430sdp-flash.o \
+  bci.o
 obj-$(CONFIG_MACH_OMAP3EVM)+= board-omap3evm.o \
   hsmmc.o \
   usb-musb.o usb-ehci.o \
Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2008-07-03
16:58:02.0 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c  2008-07-03
16:58:30.0 +0530
@@ -299,6 +299,7 @@ static void __init omap_3430sdp_init(voi
ARRAY_SIZE(sdp3430_spi_board_info));
ads7846_dev_init();
sdp3430_flash_init();
+   twl4030_bci_battery_init();
omap_serial_init();
usb_musb_init();
usb_ehci_init();
Index: linux-omap-2.6/include/asm-arm/arch-omap/board-3430sdp.h
===
--- linux-omap-2.6.orig/include/asm-arm/arch-omap/board-3430sdp.h   
2008-07-03
16:58:02.0 +0530
+++ linux-omap-2.6/include/asm-arm/arch-omap/board-3430sdp.h2008-07-03
16:58:30.0 +0530
@@ -31,6 +31,7 @@

 extern void sdp3430_usb_init(void);
 extern void sdp3430_flash_init(void);
+extern void twl4030_bci_battery_init(void);

 #define DEBUG_BASE 0x0800  /* debug board */

Index: linux-omap-2.6/arch/arm/mach-omap2/bci.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-omap-2.6/arch/arm/mach-omap2/bci.c2008-07-03 19:40:37.0 
+0530
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/arm/mach-omap2/bci.c
+ *
+ * TWL4030 BCI platform device setup/initialization
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+
+#if defined(CONFIG_TWL4030_BCI_BATTERY) || \
+   defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
+
+static struct platform_device twl4030_bci_battery_device = {
+   .name   = twl4030-bci-battery,
+   .id = -1,
+   .num_resources  = 0,
+};
+
+void __init twl4030_bci_battery_init(void)
+{
+   (void) platform_device_register(twl4030_bci_battery_device);
+}
+#else
+void __init twl4030_bci_battery_init(void)
+{
+}
+#endif


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


Re: 34xx off-mode support fixes

2008-07-03 Thread Högander Jouni
Hi Tero,

ext Tero Kristo [EMAIL PROTECTED] writes:

 Hi,

 This patch set contains some experimental fixes for the cpu-idle support from
 Rajendra Nayak. With this patch set, all power domains enter OFF mode and
 recover from it, at least while using suspend and/or dynamic idle. If you
 are using these patches, you should disable CPU_IDLE support from kernel
 config as I am not certain it works with this patch set yet. The last patch
 contains some trial fix to cpuidle code, so it might work also if you are
 lucky enough.

Do you have any guesses what is wrong in Rajendras cpuidle
code? Is it that dma save/restore? At least I couldn't figure it out
from your patches.

-- 
Jouni Högander

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


RE: [RESEND][PATCH]Separate out 3430 LCD panel support from 2430 file

2008-07-03 Thread Gadiyar, Anand
 * [EMAIL PROTECTED] [EMAIL PROTECTED] [080702 15:25]:
  From: Iqbal Shareef [EMAIL PROTECTED]
 
  Separate out 3430 LCD panel support from 2430 SDP.
 
  Currently the support for the LCD on 3430SDP is added in
 the lcd_2430sdp.c
  file. This patch separates it out to a new file.

 Pushing today.

 Tony

This one breaks compile on 3430. Will see if I can send a fix.


- Anand

  Signed-off-by: Iqbal Shareef  [EMAIL PROTECTED]
 
  ---
   arch/arm/mach-omap2/board-3430sdp.c |2 +-
   drivers/video/omap/Makefile |2 +-
   drivers/video/omap/lcd_3430sdp.c|  162
 +++
   3 files changed, 164 insertions(+), 2 deletions(-)
   create mode 100644 drivers/video/omap/lcd_3430sdp.c
 
  diff --git a/arch/arm/mach-omap2/board-3430sdp.c
 b/arch/arm/mach-omap2/board-3430sdp.c
  index f6cd08b..7a216cc 100644
  --- a/arch/arm/mach-omap2/board-3430sdp.c
  +++ b/arch/arm/mach-omap2/board-3430sdp.c
  @@ -204,7 +204,7 @@ static struct spi_board_info
 sdp3430_spi_board_info[] __initdata = {
   };
 
   static struct platform_device sdp3430_lcd_device = {
  - .name   = sdp2430_lcd,
  + .name   = sdp3430_lcd,
.id = -1,
   };
 
  diff --git a/drivers/video/omap/Makefile
 b/drivers/video/omap/Makefile
  index fe7ee5d..a72a2d9 100644
  --- a/drivers/video/omap/Makefile
  +++ b/drivers/video/omap/Makefile
  @@ -30,7 +30,7 @@ objs-y$(CONFIG_MACH_SX1) += lcd_sx1.o
 
   objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o
   objs-y$(CONFIG_MACH_OMAP_2430SDP) += lcd_2430sdp.o
  -objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_2430sdp.o
  +objs-y$(CONFIG_MACH_OMAP_3430SDP) += lcd_3430sdp.o
   objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o
   objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o
   objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
  diff --git a/drivers/video/omap/lcd_3430sdp.c
 b/drivers/video/omap/lcd_3430sdp.c
  new file mode 100644
  index 000..20ac0e5
  --- /dev/null
  +++ b/drivers/video/omap/lcd_3430sdp.c
  @@ -0,0 +1,162 @@
  +/*
  + * LCD panel support for the TI 3430SDP board
  + *
  + * Copyright (C) 2008 Texas Instruments
  + * Author: Iqbal Shareef [EMAIL PROTECTED]
  + *
  + * Derived from drivers/video/omap/lcd_2430sdp.c
  + * Copyright (C) 2007 MontaVista
  + * Author: Hunyue Yau [EMAIL PROTECTED]
  + *
  + * This program is free software; you can redistribute it
 and/or modify it
  + * under the terms of the GNU General Public License as
 published by the
  + * Free Software Foundation; either version 2 of the
 License, or (at your
  + * option) any later version.
  + *
  + * This program is distributed in the hope that it will be
 useful, but
  + * WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 See the GNU
  + * General Public License for more details.
  + *
  + * You should have received a copy of the GNU General
 Public License along
  + * with this program; if not, write to the Free Software
 Foundation, Inc.,
  + * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  + */
  +
  +#include linux/module.h
  +#include linux/platform_device.h
  +#include linux/i2c/twl4030.h
  +
  +#include asm/arch/gpio.h
  +#include asm/arch/omapfb.h
  +
  +#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
  +#define SDP3430_LCD_PANEL_ENABLE_GPIO5
  +
  +static unsigned backlight_gpio;
  +static unsigned enable_gpio;
  +
  +#define LCD_PIXCLOCK_MAX 167000
  +#define ENABLE_VAUX2_DEDICATED   0x03
  +#define ENABLE_VAUX2_DEV_GRP 0x20
  +#define ENABLE_VAUX3_DEDICATED   0x05
  +#define ENABLE_VAUX3_DEV_GRP 0xE0
  +
  +static int sdp3430_panel_init(struct lcd_panel *panel,
  + struct omapfb_device *fbdev)
  +{
  + enable_gpio= SDP3430_LCD_PANEL_ENABLE_GPIO;
  + backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO;
  +
  + omap_request_gpio(enable_gpio); /*
 LCD panel */
  + omap_request_gpio(backlight_gpio);  /*
 LCD backlight */
  + omap_set_gpio_direction(enable_gpio, 0);/* output */
  + omap_set_gpio_direction(backlight_gpio, 0); /* output */
  +
  + return 0;
  +}
  +
  +static void sdp3430_panel_cleanup(struct lcd_panel *panel)
  +{
  + omap_free_gpio(backlight_gpio);
  + omap_free_gpio(enable_gpio);
  +}
  +
  +static int sdp3430_panel_enable(struct lcd_panel *panel)
  +{
  + omap_set_gpio_dataout(enable_gpio, 1);
  + omap_set_gpio_dataout(backlight_gpio, 1);
  +
  + if (0 !=
 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
 ENABLE_VAUX3_DEDICATED,
  + TWL4030_VAUX3_DEDICATED))
  + return -EIO;
  + if (0 != twl4030_i2c_write_u8(PM_RECEIVER,
 ENABLE_VAUX3_DEV_GRP,
  + TWL4030_VAUX3_DEV_GRP))
  + return -EIO;
  +
  + return 0;
  +}
  +