Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 06/13] da850: pruss CAN board specific additions.
From: Subhasish Ghosh @ 2011-02-18  7:19 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4D5583CF.8010905@mvista.com>



--------------------------------------------------
From: "Sergei Shtylyov" <sshtylyov@mvista.com>
Sent: Saturday, February 12, 2011 12:15 AM
To: "Subhasish Ghosh" <subhasish@mistralsolutions.com>
Cc: <davinci-linux-open-source@linux.davincidsp.com>; 
<sachi@mistralsolutions.com>; "Russell King" <linux@arm.linux.org.uk>; 
"Kevin Hilman" <khilman@deeprootsystems.com>; <nsekhar@ti.com>; "open list" 
<linux-kernel@vger.kernel.org>; <m-watkins@ti.com>; 
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 06/13] da850: pruss CAN board specific additions.

> Subhasish Ghosh wrote:
>
>> This patch adds the pruss CAN pin mux and registers the device
>> with the pruss mfd driver.
>
>> Signed-off-by: Subhasish Ghosh <subhasish@mistralsolutions.com>
> [...]
>
>> diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
>> b/arch/arm/mach-davinci/board-da850-evm.c
>> index 242d1ed..2ce5536 100644
>> --- a/arch/arm/mach-davinci/board-da850-evm.c
>> +++ b/arch/arm/mach-davinci/board-da850-evm.c
>> @@ -1053,8 +1053,43 @@ static __init int da850_evm_init_cpufreq(void)
> [...]
>>  static struct da8xx_pruss_devices pruss_devices[] = {
>> - {.dev_name = NULL,},
>> + {
>> + .dev_name = "da8xx_pruss_can",
>> + .pdata = &can_data,
>> + .pdata_size = sizeof(can_data),
>> + .setup = da850_evm_setup_pruss_can,
>> + },
>> + {
>> + .dev_name = NULL,
>> + },
>
>    No need to explicitly initialize to NULL.

SG -- ok, Will remove
>
> WBR, Sergei 

^ permalink raw reply

* [PATCH v2 06/13] da850: pruss CAN board specific additions.
From: Subhasish Ghosh @ 2011-02-18  7:19 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4D5583CF.8010905@mvista.com>



--------------------------------------------------
From: "Sergei Shtylyov" <sshtylyov@mvista.com>
Sent: Saturday, February 12, 2011 12:15 AM
To: "Subhasish Ghosh" <subhasish@mistralsolutions.com>
Cc: <davinci-linux-open-source@linux.davincidsp.com>; 
<sachi@mistralsolutions.com>; "Russell King" <linux@arm.linux.org.uk>; 
"Kevin Hilman" <khilman@deeprootsystems.com>; <nsekhar@ti.com>; "open list" 
<linux-kernel@vger.kernel.org>; <m-watkins@ti.com>; 
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 06/13] da850: pruss CAN board specific additions.

> Subhasish Ghosh wrote:
>
>> This patch adds the pruss CAN pin mux and registers the device
>> with the pruss mfd driver.
>
>> Signed-off-by: Subhasish Ghosh <subhasish@mistralsolutions.com>
> [...]
>
>> diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
>> b/arch/arm/mach-davinci/board-da850-evm.c
>> index 242d1ed..2ce5536 100644
>> --- a/arch/arm/mach-davinci/board-da850-evm.c
>> +++ b/arch/arm/mach-davinci/board-da850-evm.c
>> @@ -1053,8 +1053,43 @@ static __init int da850_evm_init_cpufreq(void)
> [...]
>>  static struct da8xx_pruss_devices pruss_devices[] = {
>> - {.dev_name = NULL,},
>> + {
>> + .dev_name = "da8xx_pruss_can",
>> + .pdata = &can_data,
>> + .pdata_size = sizeof(can_data),
>> + .setup = da850_evm_setup_pruss_can,
>> + },
>> + {
>> + .dev_name = NULL,
>> + },
>
>    No need to explicitly initialize to NULL.

SG -- ok, Will remove
>
> WBR, Sergei 

^ permalink raw reply

* [PATCH v2 03/13] da850: pruss board specific additions.
From: Subhasish Ghosh @ 2011-02-18  7:18 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4D558337.2060401@mvista.com>



--------------------------------------------------
From: "Sergei Shtylyov" <sshtylyov@mvista.com>
Sent: Saturday, February 12, 2011 12:13 AM
To: "Subhasish Ghosh" <subhasish@mistralsolutions.com>
Cc: <davinci-linux-open-source@linux.davincidsp.com>; 
<sachi@mistralsolutions.com>; "Russell King" <linux@arm.linux.org.uk>; 
"Kevin Hilman" <khilman@deeprootsystems.com>; "open list" 
<linux-kernel@vger.kernel.org>; <m-watkins@ti.com>; 
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 03/13] da850: pruss board specific additions.

> Subhasish Ghosh wrote:
>
>> This patch adds board specific initializations and setup routines.
>
>> Signed-off-by: Subhasish Ghosh <subhasish@mistralsolutions.com>
> [...]
>
>> diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
>> b/arch/arm/mach-davinci/board-da850-evm.c
>> index 11f986b..242d1ed 100644
>> --- a/arch/arm/mach-davinci/board-da850-evm.c
>> +++ b/arch/arm/mach-davinci/board-da850-evm.c
>> @@ -1053,6 +1053,26 @@ static __init int da850_evm_init_cpufreq(void)
>>  static __init int da850_evm_init_cpufreq(void) { return 0; }
>>  #endif
>>  +static struct da8xx_pruss_devices pruss_devices[] = {
>> + {.dev_name = NULL,},
>
>    No need to explicitly initialize to NULL.
>
SG - Ok, Will remove

> WBR, Sergei
> 

^ permalink raw reply

* [PATCH v2 02/13] da850: pruss platform specific additions.
From: Subhasish Ghosh @ 2011-02-18  7:18 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4D5582D1.9040005@mvista.com>

--------------------------------------------------
From: "Sergei Shtylyov" <sshtylyov@mvista.com>
Sent: Saturday, February 12, 2011 12:11 AM
To: "Subhasish Ghosh" <subhasish@mistralsolutions.com>
Cc: <davinci-linux-open-source@linux.davincidsp.com>; 
<linux-arm-kernel@lists.infradead.org>; <m-watkins@ti.com>; 
<nsekhar@ti.com>; <sachi@mistralsolutions.com>; "Kevin Hilman (supporter:TI 
DAVINCI MACHIN...,commit_signer:16/18=89%)" <khilman@deeprootsystems.com>; 
"Russell King (maintainer:ARM PORT)" <linux@arm.linux.org.uk>; "Michael 
Williamson (commit_signer:5/18=28%)" <michael.williamson@criticallink.com>; 
"Cyril Chemparathy (commit_signer:3/18=17%)" <cyril@ti.com>; "Sergei 
Shtylyov (commit_signer:3/18=17%)" <sshtylyov@ru.mvista.com>; "open list" 
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 02/13] da850: pruss platform specific additions.

> Hello.
>
> Subhasish Ghosh wrote:
>
>> This patch adds the platform device and assignes the platform resources
>> for the PRUSS mfd driver.
>
>    You also add the PRUSS clock (and I would have done that as a separate 
> patch).
>
>> Signed-off-by: Subhasish Ghosh <subhasish@mistralsolutions.com>
>
>    You should have noted the patch dependency here -- this patch depends 
> on the one nenaming DA8XX_LPSC0_DMAX.

SG - Will do
>
> WBR, Sergei 

^ permalink raw reply

* [PATCH v2 11/13] da850: pruss SUART board specific additions.
From: Subhasish Ghosh @ 2011-02-18  7:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4D555523.7040507@criticallink.com>

--------------------------------------------------
From: "Michael Williamson" <michael.williamson@criticallink.com>
Sent: Friday, February 11, 2011 8:56 PM
To: "Subhasish Ghosh" <subhasish@mistralsolutions.com>
Cc: <davinci-linux-open-source@linux.davincidsp.com>; 
<sachi@mistralsolutions.com>; "Russell King" <linux@arm.linux.org.uk>; 
"Kevin Hilman" <khilman@deeprootsystems.com>; "open list" 
<linux-kernel@vger.kernel.org>; <m-watkins@ti.com>; 
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 11/13] da850: pruss SUART board specific additions.

> Hi Subhasish,
>
> On 2/11/2011 9:51 AM, Subhasish Ghosh wrote:
>
>> This patch adds the pruss SUART pin mux and registers the device
>> with the pruss mfd driver.
>>
>> Signed-off-by: Subhasish Ghosh <subhasish@mistralsolutions.com>
>> ---
>>  arch/arm/mach-davinci/board-da850-evm.c |   36 
>> +++++++++++++++++++++++++++++++
>>  1 files changed, 36 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
>> b/arch/arm/mach-davinci/board-da850-evm.c
>> index f9c38f8..3858516 100644
>> --- a/arch/arm/mach-davinci/board-da850-evm.c
>> +++ b/arch/arm/mach-davinci/board-da850-evm.c
>> @@ -1060,6 +1060,25 @@ const short da850_evm_pruss_can_pins[] = {
>>  -1
>>  };
>>
>> +const short da850_evm_pruss_suart_pins[] = {
>> + DA850_AHCLKX, DA850_ACLKX, DA850_AFSX,
>> + DA850_AHCLKR, DA850_ACLKR, DA850_AFSR,
>> + DA850_AXR_13, DA850_AXR_9, DA850_AXR_7,
>> + DA850_AXR_14, DA850_AXR_10, DA850_AXR_8,
>> + -1
>> +};
>> +
>
>
> Shouldn't this pins select PRU[0,1]_XXX type functions and not McASP 
> functions?
> E.G.: PRU0_R31[17] instead of AHCLKX, PRU0_R31[18] instead of AHCLKR, etc.
>

SG - The Soft-UART implementation uses the McASP as shift registers to push 
out the data sequentially.
            Hence, we configure the McASP PINS and not the PRU PINS.

>> +static int __init da850_evm_setup_pruss_suart(void)
>> +{
>> + int ret;
>> +
>> + ret = davinci_cfg_reg_list(da850_evm_pruss_suart_pins);
>> + if (ret)
>> + pr_warning("%s: da850_evm_pruss_suart_pins "
>> + "mux setup failed: %d\n", __func__, ret);
>> + return ret;
>> +}
>> +
>>  static int __init da850_evm_setup_pruss_can(void)
>>  {
>>  int ret, val = 0;
>> @@ -1085,6 +1104,17 @@ static int __init da850_evm_setup_pruss_can(void)
>>  return ret;
>>  }
>>
>> +static struct da850_evm_pruss_suart_data suart_data = {
>> + .version = 1,
>> + .resource = {
>> + .name = "da8xx_mcasp0_iomem",
>> + .start = DAVINCI_DA8XX_MCASP0_REG_BASE,
>> + .end = DAVINCI_DA8XX_MCASP0_REG_BASE +
>> + (SZ_1K * 12) - 1,
>> + .flags = IORESOURCE_MEM,
>> + },
>> +};
>> +
>>  static struct da8xx_pruss_can_data can_data = {
>>  .version = 1,
>>  };
>> @@ -1094,6 +1124,12 @@ static struct da8xx_pruss_devices pruss_devices[] 
>> = {
>>  .dev_name = "da8xx_pruss_can",
>>  .pdata = &can_data,
>>  .pdata_size = sizeof(can_data),
>> + .setup = da850_evm_setup_pruss_suart,
>
>
> Should this be da850_evm_setup_pruss_can instead?

SG - This just the way the patch is displayed. In the code the order is 
correct.

>
>> + },
>> + {
>> + .dev_name = "da8xx_pruss_uart",
>> + .pdata = &suart_data,
>> + .pdata_size = sizeof(suart_data),
>>  .setup = da850_evm_setup_pruss_can,
>
>
> Should this be da850_evm_setup_pruss_suart instead?
SG - Ditto
>
>>  },
>>  {
>
>
> -Mike
> 

^ permalink raw reply

* [PATCH 1/1] ARM: imx53: correct Silicon Revision definition following fuse map
From: Baruch Siach @ 2011-02-18  7:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298008049-20352-1-git-send-email-richard.zhao@freescale.com>

Hi Richard,

On Fri, Feb 18, 2011 at 01:47:29PM +0800, Richard Zhao wrote:
> Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
> 
> diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c
> index d40671d..95fd5f8 100644
> --- a/arch/arm/mach-mx5/cpu.c
> +++ b/arch/arm/mach-mx5/cpu.c
> @@ -76,13 +76,25 @@ late_initcall(mx51_neon_fixup);
>  static int get_mx53_srev(void)
>  {
>  	void __iomem *iim_base = MX51_IO_ADDRESS(MX53_IIM_BASE_ADDR);
> -	u32 rev = readl(iim_base + IIM_SREV) & 0xff;
> +	u32 reg = readl(iim_base + IIM_SREV) & 0xff;
> +	int rev;
> +
> +	switch (reg) {
> +	case 0x0:
> +		rev = IMX_CHIP_REVISION_1_0;
> +		break;
> +	case 0x2:
> +		rev = IMX_CHIP_REVISION_2_0;
> +		break;
> +	case 0x3:
> +		rev = IMX_CHIP_REVISION_2_1;
> +		break;
> +	default:
> +		rev = IMX_CHIP_REVISION_UNKNOWN;
> +		break;
> +	}
>  
> -	if (rev == 0x0)
> -		return IMX_CHIP_REVISION_1_0;
> -	else if (rev == 0x10)
> -		return IMX_CHIP_REVISION_2_0;
> -	return 0;
> +	return rev;
>  }
>  
>  /*

I think the following code is shorter and more readable:

switch (reg) {
case 0x0:
    return IMX_CHIP_REVISION_1_0;
case 0x2:
    return IMX_CHIP_REVISION_2_0;
case 0x3:
    return IMX_CHIP_REVISION_2_1;
default:
    return IMX_CHIP_REVISION_UNKNOWN;
}

baruch


-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply

* [PATCH v2 09/13] can: pruss CAN driver.
From: Subhasish Ghosh @ 2011-02-18  7:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20110211152026.GC373@e-circ.dyndns.org>

--------------------------------------------------
From: "Kurt Van Dijck" <kurt.van.dijck@eia.be>
Sent: Friday, February 11, 2011 8:50 PM
To: "Subhasish Ghosh" <subhasish@mistralsolutions.com>
Cc: <davinci-linux-open-source@linux.davincidsp.com>; 
<linux-arm-kernel@lists.infradead.org>; <m-watkins@ti.com>; 
<nsekhar@ti.com>; <sachi@mistralsolutions.com>; "Wolfgang Grandegger" 
<wg@grandegger.com>; "open list:CAN NETWORK DRIVERS" 
<socketcan-core@lists.berlios.de>; "open list:CAN NETWORK DRIVERS" 
<netdev@vger.kernel.org>; "open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 09/13] can: pruss CAN driver.

> Hi,
>
> I looked a bit at the TX path:
>
> On Fri, Feb 11, 2011 at 08:21:28PM +0530, Subhasish Ghosh wrote:
>> +static int omapl_pru_can_set_bittiming(struct net_device *ndev)
>> +{
>> + struct omapl_pru_can_priv *priv = netdev_priv(ndev);
>> + struct can_bittiming *bt = &priv->can.bittiming;
>> + long bit_error = 0;
>> +
>> + if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) {
>> + dev_warn(priv->dev, "WARN: Triple"
>> + "sampling not set due to h/w limitations");
> You should not have enabled CAN_CTRLMODE_3_SAMPLES in the first place?

SG - Ok Will remove.
>> + }
>> + if (pru_can_calc_timing(priv->dev, priv->can.clock.freq,
>> + bt->bitrate) != 0)
>> + return -EINVAL;
>> + bit_error =
>> +     (((priv->timer_freq / (priv->timer_freq / bt->bitrate)) -
>> +       bt->bitrate) * 1000) / bt->bitrate;
>> + if (bit_error) {
>> + bit_error =
>> +     (((priv->timer_freq / (priv->timer_freq / bt->bitrate)) -
>> +       bt->bitrate) * 1000000) / bt->bitrate;
>> + printk(KERN_INFO "\nBitrate error %ld.%ld%%\n",
>> + bit_error / 10000, bit_error % 1000);
>> + } else
>> + printk(KERN_INFO "\nBitrate error 0.0%%\n");
>> +
>> + return 0;
>> +}
> I wonder how much of this code is duplicated from drivers/net/can/dev.c ?
SG - Well, I just followed ti_hecc.c :-)

>
>> +static netdev_tx_t omapl_pru_can_start_xmit(struct sk_buff *skb,
>> +     struct net_device *ndev)
>> +{
>> + struct omapl_pru_can_priv *priv = netdev_priv(ndev);
>> + struct can_frame *cf = (struct can_frame *)skb->data;
>> + int count;
>> + u8 *data = cf->data;
>> + u8 dlc = cf->can_dlc;
>> + u8 *ptr8data = NULL;
>> +
> most drivers start with:
> if (can_dropped_invalid_skb(dev, skb))
> return NETDEV_TX_OK;

SG - Will do.
>
>> + netif_stop_queue(ndev);
> why would you stop when you just resumed the queue?

SG - I do not want more than one transmit request at one time. Hence, on 
entering the transmit
I am using netif_stop_queue to disable tx.

>> + if (cf->can_id & CAN_EFF_FLAG) /* Extended frame format */
>> + *((u32 *) &priv->can_tx_hndl.strcanmailbox) =
>> +     (cf->can_id & CAN_EFF_MASK) | PRU_CANMID_IDE;
>> + else /* Standard frame format */
>> + *((u32 *) &priv->can_tx_hndl.strcanmailbox) =
>> +     (cf->can_id & CAN_SFF_MASK) << 18;
>> +
>> + if (cf->can_id & CAN_RTR_FLAG) /* Remote transmission request */
>> + *((u32 *) &priv->can_tx_hndl.strcanmailbox) |= CAN_RTR_FLAG;
>> +
>> + ptr8data = &priv->can_tx_hndl.strcanmailbox.u8data7 + (dlc - 1);
>> + for (count = 0; count < (u8) dlc; count++) {
>> + *ptr8data-- = *data++;
>> + }
>> + *((u32 *) &priv->can_tx_hndl.strcanmailbox.u16datalength) = (u32) dlc;
>> +/*
>> + * search for the next available mbx
>> + * if the next mbx is busy, then try the next + 1
>> + * do this until the head is reached.
>> + * if still unable to tx, stop accepting any packets
>> + * if able to tx and the head is reached, then reset next to tail, i.e 
>> mbx0
>> + * if head is not reached, then just point to the next mbx
>> + */
>> + for (; priv->tx_next <= priv->tx_head; priv->tx_next++) {
>> + priv->can_tx_hndl.ecanmailboxnumber =
>> +     (can_mailbox_number) priv->tx_next;
>> + if (-1 == pru_can_write_data_to_mailbox(priv->dev,
>> + &priv->can_tx_hndl)) {
>> + if (priv->tx_next == priv->tx_head) {
>> + priv->tx_next = priv->tx_tail;
>> + if (!netif_queue_stopped(ndev))
> If you get here, the queue is not stopped. This test is therefore useless.

SG -Ok, will remove
>> + netif_stop_queue(ndev); /* IF stalled */
>> + dev_err(priv->dev,
>> + "%s: no tx mbx available", __func__);
>> + return NETDEV_TX_BUSY;
>> + } else
>> + continue;
>> + } else {
>> + /* set transmit request */
>> + pru_can_tx(priv->dev, priv->tx_next, CAN_TX_PRU_1);
>> + pru_can_tx_mode_set(priv->dev, false, ecanreceive);
>> + pru_can_tx_mode_set(priv->dev, true, ecantransmit);
>> + pru_can_start_abort_tx(priv->dev, PRU_CAN_START);
>> + priv->tx_next++;
>> + can_put_echo_skb(skb, ndev, 0);
>> + break;
>> + }
>> + }
>> + if (priv->tx_next > priv->tx_head) {
>> + priv->tx_next = priv->tx_tail;
>> + }
>> + return NETDEV_TX_OK;
>> +}
>> +
>> +
>
>> +irqreturn_t omapl_tx_can_intr(int irq, void *dev_id)
>> +{
>> + struct net_device *ndev = dev_id;
>> + struct omapl_pru_can_priv *priv = netdev_priv(ndev);
>> + struct net_device_stats *stats = &ndev->stats;
>> + u32 bit_set, mbxno;
>> +
>> + pru_can_get_intr_status(priv->dev, &priv->can_tx_hndl);
>> + if ((PRU_CAN_ISR_BIT_CCI & priv->can_tx_hndl.u32interruptstatus)
>> +     || (PRU_CAN_ISR_BIT_SRDI & priv->can_tx_hndl.u32interruptstatus)) {
>> + __can_debug("tx_int_status = 0x%X\n",
>> +     priv->can_tx_hndl.u32interruptstatus);
>> + can_free_echo_skb(ndev, 0);
>> + } else {
>> + for (bit_set = 0; ((priv->can_tx_hndl.u32interruptstatus & 0xFF)
>> + >> bit_set != 0); bit_set++)
>> + ;
>> + if (0 == bit_set) {
>> + __can_err("%s: invalid mailbox number\n", __func__);
>> + can_free_echo_skb(ndev, 0);
>> + } else {
>> + mbxno = bit_set - 1; /* mail box numbering starts from 0 */
>> + if (PRU_CAN_ISR_BIT_ESI & priv->can_tx_hndl.
>> +     u32interruptstatus) {
>> + /* read gsr and ack pru */
>> + pru_can_get_global_status(priv->dev, &priv->can_tx_hndl);
>> + omapl_pru_can_err(ndev,
>> +   priv->can_tx_hndl.
>> +   u32interruptstatus,
>> +   priv->can_tx_hndl.
>> +   u32globalstatus);
>> + } else {
>> + stats->tx_packets++;
>> + /* stats->tx_bytes += dlc; */
>> + /*can_get_echo_skb(ndev, 0);*/
>> + }
>> + }
>> + }
>> + if (netif_queue_stopped(ndev))
> you can call netif_wake_queue(ndev) multiple times, so there is no need
> for netif_queue_stopped()

SG -Ok, will remove

>> + netif_wake_queue(ndev);
>> +
>> + can_get_echo_skb(ndev, 0);
>> + pru_can_tx_mode_set(priv->dev, true, ecanreceive);
>> + return IRQ_HANDLED;
>> +}
>> +
>> +static int omapl_pru_can_open(struct net_device *ndev)
>> +{
>> + struct omapl_pru_can_priv *priv = netdev_priv(ndev);
>> + int err;
>> +
>> + /* register interrupt handler */
>> + err = request_irq(priv->trx_irq, &omapl_rx_can_intr, IRQF_SHARED,
>> +   "pru_can_irq", ndev);
> you're doing a lot of work _in_ the irq handler. Maybe threaded irq?
>
SG -Ok, will do

>> +static int omapl_pru_can_close(struct net_device *ndev)
>> +{
>> + struct omapl_pru_can_priv *priv = netdev_priv(ndev);
>> +
>> + if (!netif_queue_stopped(ndev))
> check is not needed.

SG -Ok, will remove

>> + netif_stop_queue(ndev);
>> +
>> + close_candev(ndev);
>> +
>> + free_irq(priv->trx_irq, ndev);
>> + return 0;
>> +}
>> +
>
> Regards,
> Kurt 

^ permalink raw reply

* [PATCH] tosa-bt: drop setting LED trigger name, as it's unsupported now
From: Eric Miao @ 2011-02-18  6:20 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1297679802-24669-1-git-send-email-dbaryshkov@gmail.com>

On Mon, Feb 14, 2011 at 6:36 PM, Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com> wrote:
> Since 2e48928d8a0f38c1b5c81eb3f1294de8a6382c68 it's no longer possible to set
> the name of the LED trigger for RFKILL events. Drop respective code from tosa-bt.c
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Cc: Stephen Hemminger <shemminger@vyatta.com>
> Cc: John W. Linville <linville@tuxdriver.com>

Applied to 'fix'.

I hope there is no existing user of this trigger name, but you know
better than I do.

> ---
> ?arch/arm/mach-pxa/tosa-bt.c | ? ?2 --
> ?1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/tosa-bt.c b/arch/arm/mach-pxa/tosa-bt.c
> index c31e601..b9b1e5c 100644
> --- a/arch/arm/mach-pxa/tosa-bt.c
> +++ b/arch/arm/mach-pxa/tosa-bt.c
> @@ -81,8 +81,6 @@ static int tosa_bt_probe(struct platform_device *dev)
> ? ? ? ? ? ? ? ?goto err_rfk_alloc;
> ? ? ? ?}
>
> - ? ? ? rfkill_set_led_trigger_name(rfk, "tosa-bt");
> -
> ? ? ? ?rc = rfkill_register(rfk);
> ? ? ? ?if (rc)
> ? ? ? ? ? ? ? ?goto err_rfkill;
> --
> 1.7.2.3
>
>

^ permalink raw reply

* [PATCH 2/2] ARM i.MX23/28: Add framebuffer device support
From: Shawn Guo @ 2011-02-18  6:14 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1297850199-1688-3-git-send-email-s.hauer@pengutronix.de>

On Wed, Feb 16, 2011 at 10:56:39AM +0100, Sascha Hauer wrote:
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Shawn Guo <shawn.guo@freescale.com>
> ---
>  arch/arm/mach-mxs/clock-mx23.c             |    2 +-
>  arch/arm/mach-mxs/clock-mx28.c             |    1 +
>  arch/arm/mach-mxs/devices-mx23.h           |    4 ++
>  arch/arm/mach-mxs/devices-mx28.h           |    4 ++
>  arch/arm/mach-mxs/devices/Kconfig          |    4 ++
>  arch/arm/mach-mxs/devices/Makefile         |    1 +
>  arch/arm/mach-mxs/devices/platform-mxsfb.c |   46 ++++++++++++++++++++++++++++
>  7 files changed, 61 insertions(+), 1 deletions(-)
>  create mode 100644 arch/arm/mach-mxs/devices/platform-mxsfb.c
> 
> diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
> index ca72a05..bfc7f27 100644
> --- a/arch/arm/mach-mxs/clock-mx23.c
> +++ b/arch/arm/mach-mxs/clock-mx23.c
> @@ -446,7 +446,7 @@ static struct clk_lookup lookups[] = {
>  	_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
>  	_REGISTER_CLOCK(NULL, "usb", usb_clk)
>  	_REGISTER_CLOCK(NULL, "audio", audio_clk)
> -	_REGISTER_CLOCK(NULL, "pwm", pwm_clk)
Introducing the warning below ...

arch/arm/mach-mxs/clock-mx23.c:430: warning: ?pwm_clk? defined but not used

> +	_REGISTER_CLOCK("imx23-fb", NULL, lcdif_clk)
>  };
>  
>  static int clk_misc_init(void)
> diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
> index fd1c4c5..6a7ebcb 100644
> --- a/arch/arm/mach-mxs/clock-mx28.c
> +++ b/arch/arm/mach-mxs/clock-mx28.c
> @@ -620,6 +620,7 @@ static struct clk_lookup lookups[] = {
>  	_REGISTER_CLOCK(NULL, "pwm", pwm_clk)
>  	_REGISTER_CLOCK(NULL, "lradc", lradc_clk)
>  	_REGISTER_CLOCK(NULL, "spdif", spdif_clk)
> +	_REGISTER_CLOCK("imx28-fb", NULL, lcdif_clk)
>  };
>  
>  static int clk_misc_init(void)
> diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h
> index 1256788..b9745a2 100644
> --- a/arch/arm/mach-mxs/devices-mx23.h
> +++ b/arch/arm/mach-mxs/devices-mx23.h
> @@ -10,7 +10,11 @@
>   */
>  #include <mach/mx23.h>
>  #include <mach/devices-common.h>
> +#include <mach/fb.h>
>  
Why do we have mxsfb platform device code breaking the consistency
that we are maintaining well so far? 

Generally, we have this header included in devices-common.h

>  extern const struct amba_device mx23_duart_device __initconst;
>  #define mx23_add_duart() \
>  	mxs_add_duart(&mx23_duart_device)
> +
> +struct platform_device *__init mx23_add_mxsfb(
> +		const struct mxsfb_platform_data *pdata);

Generally, this goes to devices-common.h

> diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h
> index 33773a6..c902dc7 100644
> --- a/arch/arm/mach-mxs/devices-mx28.h
> +++ b/arch/arm/mach-mxs/devices-mx28.h
> @@ -10,6 +10,7 @@
>   */
>  #include <mach/mx28.h>
>  #include <mach/devices-common.h>
> +#include <mach/fb.h>
>  
>  extern const struct amba_device mx28_duart_device __initconst;
>  #define mx28_add_duart() \
> @@ -18,3 +19,6 @@ extern const struct amba_device mx28_duart_device __initconst;
>  extern const struct mxs_fec_data mx28_fec_data[] __initconst;
>  #define mx28_add_fec(id, pdata) \
>  	mxs_add_fec(&mx28_fec_data[id], pdata)
> +
> +struct platform_device *__init mx28_add_mxsfb(
> +		const struct mxsfb_platform_data *pdata);

ditto

> diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig
> index cf7dc1a..1538cb9 100644
> --- a/arch/arm/mach-mxs/devices/Kconfig
> +++ b/arch/arm/mach-mxs/devices/Kconfig
> @@ -4,3 +4,7 @@ config MXS_HAVE_AMBA_DUART
>  
>  config MXS_HAVE_PLATFORM_FEC
>  	bool
> +
> +config MXS_HAVE_PLATFORM_MXSFB
> +	bool
> +

I understand that "mxsfb" was picked up for the device name to
reflect the driver name.  But since this is the device under mach- mxs
folder, can we simply call it "fb" just like the way you name fb.h?

In this way, we have all mxs platform device naming schema aligned,
auart, duart, dma, fb, fec, flexcan, mmc ...

> diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile
> index d0a09f6..0cf8b48 100644
> --- a/arch/arm/mach-mxs/devices/Makefile
> +++ b/arch/arm/mach-mxs/devices/Makefile
> @@ -1,2 +1,3 @@
>  obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
>  obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
> +obj-$(CONFIG_MXS_HAVE_PLATFORM_MXSFB) += platform-mxsfb.o
> diff --git a/arch/arm/mach-mxs/devices/platform-mxsfb.c b/arch/arm/mach-mxs/devices/platform-mxsfb.c
> new file mode 100644
> index 0000000..632bbdc
> --- /dev/null
> +++ b/arch/arm/mach-mxs/devices/platform-mxsfb.c
> @@ -0,0 +1,46 @@
> +/*
> + * Copyright (C) 2011 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
> + *
> + * This program is free software; you can redistribute it and/or modify it under
> + * the terms of the GNU General Public License version 2 as published by the
> + * Free Software Foundation.
> + */
> +#include <asm/sizes.h>
> +#include <mach/mx23.h>
> +#include <mach/mx28.h>
> +#include <mach/devices-common.h>
> +#include <mach/fb.h>

Generally, this goes to devices-common.h

> +
> +#ifdef CONFIG_SOC_IMX23
> +struct platform_device *__init mx23_add_mxsfb(
> +		const struct mxsfb_platform_data *pdata)
> +{
> +	struct resource res[] = {
> +		{
> +			.start = MX23_LCDIF_BASE_ADDR,
> +			.end = MX23_LCDIF_BASE_ADDR + SZ_8K - 1,
> +			.flags = IORESOURCE_MEM,
> +		},
> +	};
> +
> +	return mxs_add_platform_device_dmamask("imx23-fb", -1,
> +			res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> +}
> +#endif /* ifdef CONFIG_SOC_IMX23 */
> +
> +#ifdef CONFIG_SOC_IMX28
> +struct platform_device *__init mx28_add_mxsfb(
> +		const struct mxsfb_platform_data *pdata)
> +{
> +	struct resource res[] = {
> +		{
> +			.start = MX28_LCDIF_BASE_ADDR,
> +			.end = MX28_LCDIF_BASE_ADDR + SZ_8K - 1,
> +			.flags = IORESOURCE_MEM,
> +		},
> +	};
> +
> +	return mxs_add_platform_device_dmamask("imx28-fb", -1,
> +			res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> +}
> +#endif /* ifdef CONFIG_SOC_IMX28 */

Generally, we have macro mxs_fb_data_entry and function mxs_add_fb
in this file.  It's nothing but all about consistency.  We do not
want some later coming platform device looking at this as example,
and bring more inconsistency into mach-mxs platform device codes.

-- 
Regards,
Shawn

^ permalink raw reply

* [PATCH 1/1] ARM: imx53: correct Silicon Revision definition following fuse map
From: Richard Zhao @ 2011-02-18  5:47 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>

diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c
index d40671d..95fd5f8 100644
--- a/arch/arm/mach-mx5/cpu.c
+++ b/arch/arm/mach-mx5/cpu.c
@@ -76,13 +76,25 @@ late_initcall(mx51_neon_fixup);
 static int get_mx53_srev(void)
 {
 	void __iomem *iim_base = MX51_IO_ADDRESS(MX53_IIM_BASE_ADDR);
-	u32 rev = readl(iim_base + IIM_SREV) & 0xff;
+	u32 reg = readl(iim_base + IIM_SREV) & 0xff;
+	int rev;
+
+	switch (reg) {
+	case 0x0:
+		rev = IMX_CHIP_REVISION_1_0;
+		break;
+	case 0x2:
+		rev = IMX_CHIP_REVISION_2_0;
+		break;
+	case 0x3:
+		rev = IMX_CHIP_REVISION_2_1;
+		break;
+	default:
+		rev = IMX_CHIP_REVISION_UNKNOWN;
+		break;
+	}
 
-	if (rev == 0x0)
-		return IMX_CHIP_REVISION_1_0;
-	else if (rev == 0x10)
-		return IMX_CHIP_REVISION_2_0;
-	return 0;
+	return rev;
 }
 
 /*
-- 
1.7.1

^ permalink raw reply related

* [bug-dev] [PATCHv3] mx31: add support for the bugbase 1.3 from buglabs
From: Ken Gilmer @ 2011-02-18  5:47 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1297956221.2675.1.camel@gnutoo-laptop>

No problems for that on our end Denis.

thx
ken

2011/2/17 Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>

> > And I wonder there is no copyright statement by you in
> > arch/arm/mach-mx3/mach-bug.c, maybe because you consider your changes
> > too minor to be relevant?  (INAL and I don't know who to value your
> > contribution.)
> Here is the thread:
> http://thread.gmane.org/gmane.linux.ports.arm.msm/122
>
> What should I do? can I add my own name too?
>
> Denis.
>
>
> _______________________________________________
> bug-dev mailing list
> bug-dev at lists.buglabs.net
> http://lists.buglabs.net/cgi-bin/mailman/listinfo/bug-dev
>



-- 
thx
ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110217/91e473a2/attachment-0001.html>

^ permalink raw reply

* [PATCH 00/11] OMAP2+: clock: add clockfw autoidle for iclks, OMAP2xxx
From: Rajendra Nayak @ 2011-02-18  5:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1102161551400.29817@utopia.booyaka.com>

> -----Original Message-----
> From: Paul Walmsley [mailto:paul at pwsan.com]
> Sent: Thursday, February 17, 2011 4:35 AM
> To: Rajendra Nayak
> Cc: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
> Subject: RE: [PATCH 00/11] OMAP2+: clock: add clockfw autoidle for
iclks, OMAP2xxx
>
> On Wed, 16 Feb 2011, Rajendra Nayak wrote:
>
> > Boot-tested on 3430sdp/4430sdp, with CONFIG_PM and with !CONFIG_PM.
> > suspend-offmode tested on 3430sdp and suspend-retmode on 4430sdp (with
> > some out-of-tree patches)
>
> Thanks, will add Tested-by:s.
>
> > Dynamic idle testing on 3430sdp showed me some very jerky debug
console
> > the moment a 'echo 1 > /debug/pm_debug/sleep_while_idle' is done. This
> > however seems to be the case even on 2.6.38-rc4 and not related to the
> > current patch series.
>
> Does enabling CONFIG_OMAP2_DSS resolve the problem you're seeing?

Maybe, will try it out. Thanks for the tip.

>
> > Will debug further, but seems to some 3430sdp specific issue, since
you
> > did not see it on Beagleboard and seems it is not seen on OMAP3 zoom's
> > either. Just out of curiosity, what dynamic-idle state where you able
to
> > achieve on Beagle?
>
> Full chip off.  I use omap2plus_defconfig, sometimes with
CONFIG_OMAP2_DSS
> depending on personal mood and what's being tested.  I boot to a shell
and
> run the commands at the end of this message (some of which are probably
> superfluous).

Ok, thanks.

>
>
> - Paul
>
>
> echo 1 > /debug/pm_debug/sleep_while_idle
> echo 1 > /debug/pm_debug/enable_off_mode
> echo 5 > /sys/devices/platform/omap/omap_uart.0/sleep_timeout
> echo 5 > /sys/devices/platform/omap/omap_uart.1/sleep_timeout
> echo 5 > /sys/devices/platform/omap/omap_uart.2/sleep_timeout
> echo enabled >
/sys/devices/platform/omap/omap_uart.0/tty/ttyO0/power/wakeup
> echo enabled >
/sys/devices/platform/omap/omap_uart.1/tty/ttyO1/power/wakeup
> echo enabled >
/sys/devices/platform/omap/omap_uart.2/tty/ttyO2/power/wakeup
>

^ permalink raw reply

* [PATCH 00/11] OMAP2+: clock: add clockfw autoidle for iclks, OMAP2xxx
From: Rajendra Nayak @ 2011-02-18  5:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1102161510410.29817@utopia.booyaka.com>

Hi Paul,

> -----Original Message-----
> From: Paul Walmsley [mailto:paul at pwsan.com]
> Sent: Thursday, February 17, 2011 3:44 AM
> To: Rajendra Nayak
> Cc: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
> Subject: RE: [PATCH 00/11] OMAP2+: clock: add clockfw autoidle for
iclks, OMAP2xxx
>
> Hi Rajendra
>
> On Wed, 16 Feb 2011, Rajendra Nayak wrote:
>
> > > -----Original Message-----
> > > From: linux-arm-kernel-bounces at lists.infradead.org
> > [mailto:linux-arm-kernel-bounces at lists.infradead.org] On Behalf
> > > Of Paul Walmsley
> > > Sent: Wednesday, February 16, 2011 12:23 PM
> > >
> > > This series also ensures that all clock autoidle is disabled during
> > > boot and only re-enabled if CONFIG_PM is enabled.
> >
> > This does not seem to be the case. Maybe something like the
> > below patch is what is missing..
>
> Thanks for the review, you are absolutely right.  Rather than the patch
> you sent, and since mach-omap2/pm.c is compiled in even if !CONFIG_PM,
> I'd propose a different approach.  Until we can sort out the
> CONFIG_PM/pm.c issue, probably it would make more sense to move the
> autoidle-enable as part of CONFIG_OMAP_RESET_CLOCKS.  Will send a patch
in
> reply to the original thread.

I had a look at the patch and it does look like a better way to handle
it for now, till the CONFIG options are further cleaned up.
Thanks,
Rajendra

>
>
> - Paul

^ permalink raw reply

* [PATCH 1/2] video: Add i.MX23/28 framebuffer driver
From: Shawn Guo @ 2011-02-18  5:24 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1297850199-1688-2-git-send-email-s.hauer@pengutronix.de>

Sorry, I did not catch up with v1 of the patch set.

I have a overall comment on the driver.  There is many occurrences
of mx23, mx28 etc. throughout the file.  IMHO, this is not a good
idea.  It may be better to use the IP version to handle the
differences.  In this way, if we have another SoC coming later
using the same LCDIF revision as i.MX28.  The driver could
immediately fit in without code change, ideally.

The only problem with version register is that the offset of LCDIF
version register is different on i.MX28 from i.MX23.  You still need
cpu_is_mx23 to read the correct version.

BTW, I would try to use cpu_is_mx23 than cpu_is_mx28, as the 'else'
of cpu_is_mx23 could _possibly_ cover later SoC as well as i.MX28.

-- 
Regards,
Shawn

On Wed, Feb 16, 2011 at 10:56:38AM +0100, Sascha Hauer wrote:
> changes since v1:
> - Add a LCDC_ prefix to the register names.
> - use set/clear registers where appropriate
> - protect call to mxsfb_disable_controller() in mxsfb_remove()
>   with a (host->enabled) as suggested by Lothar Wassmann
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: linux-fbdev at vger.kernel.org
> Cc: Shawn Guo <shawn.guo@freescale.com>
> ---
>  arch/arm/mach-mxs/include/mach/fb.h |   48 ++
>  drivers/video/Kconfig               |    9 +
>  drivers/video/Makefile              |    1 +
>  drivers/video/mxsfb.c               |  910 +++++++++++++++++++++++++++++++++++
>  4 files changed, 968 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-mxs/include/mach/fb.h
>  create mode 100644 drivers/video/mxsfb.c
> 
> diff --git a/arch/arm/mach-mxs/include/mach/fb.h b/arch/arm/mach-mxs/include/mach/fb.h
> new file mode 100644
> index 0000000..923f397
> --- /dev/null
> +++ b/arch/arm/mach-mxs/include/mach/fb.h
> @@ -0,0 +1,48 @@
> +/*
> + * 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., 51 Franklin Street, Fifth Floor, Boston,
> + * MA 02110-1301, USA.
> + */
> +
> +#ifndef __MACH_FB_H
> +#define __MACH_FB_H
> +
> +#include <linux/fb.h>
> +
> +#define STMLCDIF_8BIT 1	/** pixel data bus to the display is of 8 bit width */
> +#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */
> +#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
> +#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
> +
> +#define FB_SYNC_DATA_ENABLE_HIGH_ACT	64
> +
> +struct mxsfb_platform_data {
> +	struct fb_videomode *mode_list;
> +	unsigned mode_count;
> +
> +	unsigned default_bpp;
> +
> +	unsigned dotclk_delay;	/* refer manual HW_LCDIF_VDCTRL4 register */
> +	unsigned ld_intf_width;	/* refer STMLCDIF_* macros */
> +
> +	unsigned fb_size;	/* Size of the video memory. If zero a
> +				 * default will be used
> +				 */
> +	unsigned long fb_phys;	/* physical address for the video memory. If
> +				 * zero the framebuffer memory will be dynamically
> +				 * allocated. If specified,fb_size must also be specified.
> +				 * fb_phys must be unused by Linux.
> +				 */
> +};
> +
> +#endif /* __MACH_FB_H */
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index 6bafb51b..e0ea23f 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -2365,6 +2365,15 @@ config FB_JZ4740
>  	help
>  	  Framebuffer support for the JZ4740 SoC.
>  
> +config FB_MXS
> +	tristate "MXS LCD framebuffer support"
> +	depends on FB && ARCH_MXS
> +	select FB_CFB_FILLRECT
> +	select FB_CFB_COPYAREA
> +	select FB_CFB_IMAGEBLIT
> +	help
> +	  Framebuffer support for the MXS SoC.
> +
>  source "drivers/video/omap/Kconfig"
>  source "drivers/video/omap2/Kconfig"
>  
> diff --git a/drivers/video/Makefile b/drivers/video/Makefile
> index 8c8fabd..9a096ae 100644
> --- a/drivers/video/Makefile
> +++ b/drivers/video/Makefile
> @@ -153,6 +153,7 @@ obj-$(CONFIG_FB_BFIN_T350MCQB)	  += bfin-t350mcqb-fb.o
>  obj-$(CONFIG_FB_BFIN_7393)        += bfin_adv7393fb.o
>  obj-$(CONFIG_FB_MX3)		  += mx3fb.o
>  obj-$(CONFIG_FB_DA8XX)		  += da8xx-fb.o
> +obj-$(CONFIG_FB_MXS)		  += mxsfb.o
>  
>  # the test framebuffer is last
>  obj-$(CONFIG_FB_VIRTUAL)          += vfb.o
> diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
> new file mode 100644
> index 0000000..ac9939b
> --- /dev/null
> +++ b/drivers/video/mxsfb.c
> @@ -0,0 +1,910 @@
> +/*
> + * Copyright (C) 2010 Juergen Beisert, Pengutronix
> + *
> + * This code is based on:
> + * Author: Vitaly Wool <vital@embeddedalley.com>
> + *
> + * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
> + * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
> + *
> + * 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.
> + */
> +
> +#define DRIVER_NAME "mxsfb"
> +
> +/**
> + * @file
> + * @brief LCDIF driver for i.MX23 and i.MX28
> + *
> + * The LCDIF support four modes of operation
> + * - MPU interface (to drive smart displays) -> not supported yet
> + * - VSYNC interface (like MPU interface plus Vsync) -> not supported yet
> + * - Dotclock interface (to drive LC displays with RGB data and sync signals)
> + * - DVI (to drive ITU-R BT656)  -> not supported yet
> + *
> + * This driver depends on a correct setup of the pins used for this purpose
> + * (platform specific).
> + *
> + * For the developer: Don't forget to set the data bus width to the display
> + * in the imx_fb_videomode structure. You will else end up with ugly colours.
> + * If you fight against jitter you can vary the clock delay. This is a feature
> + * of the i.MX28 and you can vary it between 2 ns ... 8 ns in 2 ns steps. Give
> + * the required value in the imx_fb_videomode structure.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +#include <linux/clk.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/io.h>
> +#include <mach/fb.h>
> +#include <mach/hardware.h>
> +#include <mach/mxs.h>
> +
> +#define REG_SET	4
> +#define REG_CLR	8
> +
> +#define LCDC_CTRL			0x00
> +#define LCDC_CTRL1			0x10
> +#define LCDC_MX28_CTRL2			0x20
> +#define LCDC_MX23_TRANSFER_COUNT	0x20
> +#define LCDC_MX28_TRANSFER_COUNT	0x30
> +#define LCDC_MX28_CUR_BUF		0x40
> +#define LCDC_MX28_NEXT_BUF		0x50
> +#define LCDC_MX23_CUR_BUF		0x30
> +#define LCDC_MX23_NEXT_BUF		0x40
> +#define LCDC_TIMING			0x60
> +#define LCDC_VDCTRL0			0x70
> +#define LCDC_VDCTRL1			0x80
> +#define LCDC_VDCTRL2			0x90
> +#define LCDC_VDCTRL3			0xa0
> +#define LCDC_VDCTRL4			0xb0
> +#define LCDC_DVICTRL0			0xc0
> +#define LCDC_DVICTRL1			0xd0
> +#define LCDC_DVICTRL2			0xe0
> +#define LCDC_DVICTRL3			0xf0
> +#define LCDC_DVICTRL4			0x100
> +#define LCDC_MX28_DATA			0x180
> +#define LCDC_MX23_DATA			0x1b0
> +#define LCDC_MX28_DEBUG0		0x1d0
> +#define LCDC_MX23_DEBUG0		0x1f0
> +
> +#define CTRL_SFTRST			(1 << 31)
> +#define CTRL_CLKGATE			(1 << 30)
> +#define CTRL_BYPASS_COUNT		(1 << 19)
> +#define CTRL_VSYNC_MODE			(1 << 18)
> +#define CTRL_DOTCLK_MODE		(1 << 17)
> +#define CTRL_DATA_SELECT		(1 << 16)
> +#define CTRL_SET_BUS_WIDTH(x)		(((x) & 0x3) << 10)
> +#define CTRL_GET_BUS_WIDTH(x)		(((x) >> 10) & 0x3)
> +#define CTRL_SET_WORD_LENGTH(x)		(((x) & 0x3) << 8)
> +#define CTRL_GET_WORD_LENGTH(x)		(((x) >> 8) & 0x3)
> +#define CTRL_MASTER			(1 << 5)
> +#define CTRL_DF16			(1 << 3)
> +#define CTRL_DF18			(1 << 2)
> +#define CTRL_DF24			(1 << 1)
> +#define CTRL_RUN			(1 << 0)
> +
> +#define CTRL1_FIFO_CLEAR		(1 << 21)
> +#define CTRL1_SET_BYTE_PACKAGING(x)	(((x) & 0xf) << 16)
> +#define CTRL1_GET_BYTE_PACKAGING(x)	(((x) >> 16) & 0xf)
> +
> +#define TRANSFER_COUNT_SET_VCOUNT(x)	(((x) & 0xffff) << 16)
> +#define TRANSFER_COUNT_GET_VCOUNT(x)	(((x) >> 16) & 0xffff)
> +#define TRANSFER_COUNT_SET_HCOUNT(x)	((x) & 0xffff)
> +#define TRANSFER_COUNT_GET_HCOUNT(x)	((x) & 0xffff)
> +
> +
> +#define VDCTRL0_ENABLE_PRESENT		(1 << 28)
> +#define VDCTRL0_VSYNC_ACT_HIGH		(1 << 27)
> +#define VDCTRL0_HSYNC_ACT_HIGH		(1 << 26)
> +#define VDCTRL0_DOTCLK_ACTIVE_HIGH	(1 << 25)
> +#define VDCTRL0_POL_ACTIVE_HIGH		(1 << 24)
> +#define VDCTRL0_VSYNC_PERIOD_UNIT	(1 << 21)
> +#define VDCTRL0_VSYNC_PULSE_WIDTH_UNIT	(1 << 20)
> +#define VDCTRL0_HALF_LINE		(1 << 19)
> +#define VDCTRL0_HALF_LINE_MODE		(1 << 18)
> +#define VDCTRL0_SET_VSYNC_PULSE_WIDTH(x) ((x) & 0x3ffff)
> +#define VDCTRL0_GET_VSYNC_PULSE_WIDTH(x) ((x) & 0x3ffff)
> +
> +#define VDCTRL2_SET_HSYNC_PERIOD(x)	((x) & 0x3ffff)
> +#define VDCTRL2_GET_HSYNC_PERIOD(x)	((x) & 0x3ffff)
> +
> +#define VDCTRL3_MUX_SYNC_SIGNALS	(1 << 29)
> +#define VDCTRL3_VSYNC_ONLY		(1 << 28)
> +#define SET_HOR_WAIT_CNT(x)		(((x) & 0xfff) << 16)
> +#define GET_HOR_WAIT_CNT(x)		(((x) >> 16) & 0xfff)
> +#define SET_VERT_WAIT_CNT(x)		((x) & 0xffff)
> +#define GET_VERT_WAIT_CNT(x)		((x) & 0xffff)
> +
> +#define VDCTRL4_SET_DOTCLK_DLY(x)	(((x) & 0x7) << 29) /* i.MX28 only */
> +#define VDCTRL4_GET_DOTCLK_DLY(x)	(((x) >> 29) & 0x7) /* i.MX28 only */
> +#define VDCTRL4_SYNC_SIGNALS_ON		(1 << 18)
> +#define SET_DOTCLK_H_VALID_DATA_CNT(x)	((x) & 0x3ffff)
> +
> +#define DEBUG0_HSYNC			(1 < 26)
> +#define DEBUG0_VSYNC			(1 < 25)
> +
> +#define MIN_XRES			120
> +#define MIN_YRES			120
> +
> +#define RED 0
> +#define GREEN 1
> +#define BLUE 2
> +#define TRANSP 3
> +
> +enum mxsfb_devtype {
> +	MXSFB_MX23,
> +	MXSFB_MX28,
> +};
> +
> +/* CPU dependent register offsets */
> +struct mxsfb_devdata {
> +	unsigned transfer_count;
> +	unsigned cur_buf;
> +	unsigned next_buf;
> +	unsigned debug0;
> +	unsigned hs_wdth_mask;
> +	unsigned hs_wdth_shift;
> +};
> +
> +struct mxsfb_info {
> +	struct fb_info fb_info;
> +	struct platform_device *pdev;
> +	struct clk *clk;
> +	void __iomem *base;	/* registers */
> +	unsigned allocated_size;
> +	int enabled;
> +	unsigned ld_intf_width;
> +	unsigned dotclk_delay;
> +	const struct mxsfb_devdata *devdata;
> +	int mapped;
> +};
> +
> +static const struct mxsfb_devdata mxsfb_devdata[] = {
> +	[MXSFB_MX23] = {
> +		.transfer_count = LCDC_MX23_TRANSFER_COUNT,
> +		.cur_buf = LCDC_MX23_CUR_BUF,
> +		.next_buf = LCDC_MX23_NEXT_BUF,
> +		.debug0 = LCDC_MX23_DEBUG0,
> +		.hs_wdth_mask = 0xff,
> +		.hs_wdth_shift = 24,
> +	},
> +	[MXSFB_MX28] = {
> +		.transfer_count = LCDC_MX28_TRANSFER_COUNT,
> +		.cur_buf = LCDC_MX28_CUR_BUF,
> +		.next_buf = LCDC_MX28_NEXT_BUF,
> +		.debug0 = LCDC_MX28_DEBUG0,
> +		.hs_wdth_mask = 0x3fff,
> +		.hs_wdth_shift = 18,
> +	},
> +};
> +
> +#define to_imxfb_host(x) (container_of(x, struct mxsfb_info, fb_info))
> +
> +/* mask and shift depends on architecture */
> +static inline u32 set_hsync_pulse_width(struct mxsfb_info *host, unsigned val)
> +{
> +	return (val & host->devdata->hs_wdth_mask) <<
> +		host->devdata->hs_wdth_shift;
> +}
> +
> +static inline u32 get_hsync_pulse_width(struct mxsfb_info *host, unsigned val)
> +{
> +	return (val >> host->devdata->hs_wdth_shift) &
> +		host->devdata->hs_wdth_mask;
> +}
> +
> +static const struct fb_bitfield def_rgb565[] = {
> +	[RED] = {
> +		.offset = 11,
> +		.length = 5,
> +	},
> +	[GREEN] = {
> +		.offset = 5,
> +		.length = 6,
> +	},
> +	[BLUE] = {
> +		.offset = 0,
> +		.length = 5,
> +	},
> +	[TRANSP] = {	/* no support for transparency */
> +		.length = 0,
> +	}
> +};
> +
> +static const struct fb_bitfield def_rgb666[] = {
> +	[RED] = {
> +		.offset = 16,
> +		.length = 6,
> +	},
> +	[GREEN] = {
> +		.offset = 8,
> +		.length = 6,
> +	},
> +	[BLUE] = {
> +		.offset = 0,
> +		.length = 6,
> +	},
> +	[TRANSP] = {	/* no support for transparency */
> +		.length = 0,
> +	}
> +};
> +
> +static const struct fb_bitfield def_rgb888[] = {
> +	[RED] = {
> +		.offset = 16,
> +		.length = 8,
> +	},
> +	[GREEN] = {
> +		.offset = 8,
> +		.length = 8,
> +	},
> +	[BLUE] = {
> +		.offset = 0,
> +		.length = 8,
> +	},
> +	[TRANSP] = {	/* no support for transparency */
> +		.length = 0,
> +	}
> +};
> +
> +static inline unsigned chan_to_field(unsigned chan, struct fb_bitfield *bf)
> +{
> +	chan &= 0xffff;
> +	chan >>= 16 - bf->length;
> +	return chan << bf->offset;
> +}
> +
> +static int mxsfb_check_var(struct fb_var_screeninfo *var,
> +		struct fb_info *fb_info)
> +{
> +	struct mxsfb_info *host = to_imxfb_host(fb_info);
> +	const struct fb_bitfield *rgb = NULL;
> +
> +	if (var->xres < MIN_XRES)
> +		var->xres = MIN_XRES;
> +	if (var->yres < MIN_YRES)
> +		var->yres = MIN_YRES;
> +
> +	var->xres_virtual = var->xres;
> +
> +	var->yres_virtual = var->yres;
> +
> +	switch (var->bits_per_pixel) {
> +	case 16:
> +		/* always expect RGB 565 */
> +		rgb = def_rgb565;
> +		break;
> +	case 32:
> +		switch (host->ld_intf_width) {
> +		case STMLCDIF_8BIT:
> +			pr_debug("Unsupported LCD bus width mapping\n");
> +			break;
> +		case STMLCDIF_16BIT:
> +		case STMLCDIF_18BIT:
> +			/* 24 bit to 18 bit mapping */
> +			rgb = def_rgb666;
> +			break;
> +		case STMLCDIF_24BIT:
> +			/* real 24 bit */
> +			rgb = def_rgb888;
> +			break;
> +		}
> +		break;
> +	default:
> +		pr_debug("Unsupported colour depth: %u\n", var->bits_per_pixel);
> +		return -EINVAL;
> +	}
> +
> +	/*
> +	 * Copy the RGB parameters for this display
> +	 * from the machine specific parameters.
> +	 */
> +	var->red    = rgb[RED];
> +	var->green  = rgb[GREEN];
> +	var->blue   = rgb[BLUE];
> +	var->transp = rgb[TRANSP];
> +
> +	return 0;
> +}
> +
> +static void mxsfb_enable_controller(struct fb_info *fb_info)
> +{
> +	struct mxsfb_info *host = to_imxfb_host(fb_info);
> +	u32 reg;
> +
> +	dev_dbg(&host->pdev->dev, "%s\n", __func__);
> +
> +	clk_enable(host->clk);
> +	clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U);
> +
> +	/* if it was disabled, re-enable the mode again */
> +	writel(CTRL_DOTCLK_MODE, host->base + LCDC_CTRL + REG_SET);
> +
> +	/* enable the SYNC signals first, then the DMA engine */
> +	reg = readl(host->base + LCDC_VDCTRL4);
> +	reg |= VDCTRL4_SYNC_SIGNALS_ON;
> +	writel(reg, host->base + LCDC_VDCTRL4);
> +
> +	writel(CTRL_RUN, host->base + LCDC_CTRL + REG_SET);
> +
> +	host->enabled = 1;
> +}
> +
> +static void mxsfb_disable_controller(struct fb_info *fb_info)
> +{
> +	struct mxsfb_info *host = to_imxfb_host(fb_info);
> +	unsigned loop;
> +	u32 reg;
> +
> +	dev_dbg(&host->pdev->dev, "%s\n", __func__);
> +
> +	/*
> +	 * Even if we disable the controller here, it will still continue
> +	 * until its FIFOs are running out of data
> +	 */
> +	writel(CTRL_DOTCLK_MODE, host->base + LCDC_CTRL + REG_CLR);
> +
> +	loop = 1000;
> +	while (loop) {
> +		reg = readl(host->base + LCDC_CTRL);
> +		if (!(reg & CTRL_RUN))
> +			break;
> +		loop--;
> +	}
> +
> +	writel(VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4 + REG_CLR);
> +
> +	clk_disable(host->clk);
> +
> +	host->enabled = 0;
> +}
> +
> +static int mxsfb_set_par(struct fb_info *fb_info)
> +{
> +	struct mxsfb_info *host = to_imxfb_host(fb_info);
> +	u32 ctrl, vdctrl0, vdctrl4;
> +	int line_size, fb_size;
> +	int reenable = 0;
> +
> +	line_size =  fb_info->var.xres * (fb_info->var.bits_per_pixel >> 3);
> +	fb_size = fb_info->var.yres_virtual * line_size;
> +
> +	if (fb_size > fb_info->fix.smem_len)
> +		return -ENOMEM;
> +
> +	fb_info->fix.line_length = line_size;
> +
> +	/*
> +	 * It seems, you can't re-program the controller if it is still running.
> +	 * This may lead into shifted pictures (FIFO issue?).
> +	 * So, first stop the controller and drain its FIFOs
> +	 */
> +	if (host->enabled) {
> +		reenable = 1;
> +		mxsfb_disable_controller(fb_info);
> +	}
> +
> +	/* clear the FIFOs */
> +	writel(CTRL1_FIFO_CLEAR, host->base + LCDC_CTRL1 + REG_SET);
> +
> +	ctrl = CTRL_BYPASS_COUNT | CTRL_MASTER |
> +		CTRL_SET_BUS_WIDTH(host->ld_intf_width);;
> +
> +	switch (fb_info->var.bits_per_pixel) {
> +	case 16:
> +		dev_dbg(&host->pdev->dev, "Setting up RGB565 mode\n");
> +		ctrl |= CTRL_SET_WORD_LENGTH(0);
> +		writel(CTRL1_SET_BYTE_PACKAGING(0xf), host->base + LCDC_CTRL1);
> +		break;
> +	case 32:
> +		dev_dbg(&host->pdev->dev, "Setting up RGB888/666 mode\n");
> +		ctrl |= CTRL_SET_WORD_LENGTH(3);
> +		switch (host->ld_intf_width) {
> +		case STMLCDIF_8BIT:
> +			dev_dbg(&host->pdev->dev,
> +					"Unsupported LCD bus width mapping\n");
> +			return -EINVAL;
> +		case STMLCDIF_16BIT:
> +		case STMLCDIF_18BIT:
> +			/* 24 bit to 18 bit mapping */
> +			ctrl |= CTRL_DF24; /* ignore the upper 2 bits in
> +					    *  each colour component
> +					    */
> +			break;
> +		case STMLCDIF_24BIT:
> +			/* real 24 bit */
> +			break;
> +		}
> +		/* do not use packed pixels = one pixel per word instead */
> +		writel(CTRL1_SET_BYTE_PACKAGING(0x7), host->base + LCDC_CTRL1);
> +		break;
> +	default:
> +		dev_dbg(&host->pdev->dev, "Unhandled color depth of %u\n",
> +				fb_info->var.bits_per_pixel);
> +		return -EINVAL;
> +	}
> +
> +	writel(ctrl, host->base + LCDC_CTRL);
> +
> +	writel(TRANSFER_COUNT_SET_VCOUNT(fb_info->var.yres) |
> +			TRANSFER_COUNT_SET_HCOUNT(fb_info->var.xres),
> +			host->base + host->devdata->transfer_count);
> +
> +	vdctrl0 = VDCTRL0_ENABLE_PRESENT |	/* always in DOTCLOCK mode */
> +		VDCTRL0_VSYNC_PERIOD_UNIT |
> +		VDCTRL0_VSYNC_PULSE_WIDTH_UNIT |
> +		VDCTRL0_SET_VSYNC_PULSE_WIDTH(fb_info->var.vsync_len);
> +	if (fb_info->var.sync & FB_SYNC_HOR_HIGH_ACT)
> +		vdctrl0 |= VDCTRL0_HSYNC_ACT_HIGH;
> +	if (fb_info->var.sync & FB_SYNC_VERT_HIGH_ACT)
> +		vdctrl0 |= VDCTRL0_VSYNC_ACT_HIGH;
> +	if (fb_info->var.sync & FB_SYNC_DATA_ENABLE_HIGH_ACT)
> +		vdctrl0 |= VDCTRL0_POL_ACTIVE_HIGH;
> +
> +	writel(vdctrl0, host->base + LCDC_VDCTRL0);
> +
> +	/* frame length in lines */
> +	writel(fb_info->var.upper_margin + fb_info->var.vsync_len +
> +		fb_info->var.lower_margin + fb_info->var.yres,
> +		host->base + LCDC_VDCTRL1);
> +
> +	/* line length in units of clocks or pixels */
> +	writel(set_hsync_pulse_width(host, fb_info->var.hsync_len) |
> +		VDCTRL2_SET_HSYNC_PERIOD(fb_info->var.left_margin +
> +		fb_info->var.hsync_len + fb_info->var.right_margin +
> +		fb_info->var.xres),
> +		host->base + LCDC_VDCTRL2);
> +
> +	writel(SET_HOR_WAIT_CNT(fb_info->var.left_margin +
> +		fb_info->var.hsync_len) |
> +		SET_VERT_WAIT_CNT(fb_info->var.upper_margin +
> +			fb_info->var.vsync_len),
> +		host->base + LCDC_VDCTRL3);
> +
> +	vdctrl4 = SET_DOTCLK_H_VALID_DATA_CNT(fb_info->var.xres);
> +	if (cpu_is_mx28())
> +		vdctrl4 |= VDCTRL4_SET_DOTCLK_DLY(host->dotclk_delay);
> +	writel(vdctrl4, host->base + LCDC_VDCTRL4);
> +
> +	writel(fb_info->fix.smem_start +
> +			fb_info->fix.line_length * fb_info->var.yoffset,
> +			host->base + host->devdata->next_buf);
> +
> +	if (reenable)
> +		mxsfb_enable_controller(fb_info);
> +
> +	return 0;
> +}
> +
> +static int mxsfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
> +		u_int transp, struct fb_info *fb_info)
> +{
> +	unsigned int val;
> +	int ret = -EINVAL;
> +
> +	/*
> +	 * If greyscale is true, then we convert the RGB value
> +	 * to greyscale no matter what visual we are using.
> +	 */
> +	if (fb_info->var.grayscale)
> +		red = green = blue = (19595 * red + 38470 * green +
> +					7471 * blue) >> 16;
> +
> +	switch (fb_info->fix.visual) {
> +	case FB_VISUAL_TRUECOLOR:
> +		/*
> +		 * 12 or 16-bit True Colour.  We encode the RGB value
> +		 * according to the RGB bitfield information.
> +		 */
> +		if (regno < 16) {
> +			u32 *pal = fb_info->pseudo_palette;
> +
> +			val  = chan_to_field(red, &fb_info->var.red);
> +			val |= chan_to_field(green, &fb_info->var.green);
> +			val |= chan_to_field(blue, &fb_info->var.blue);
> +
> +			pal[regno] = val;
> +			ret = 0;
> +		}
> +		break;
> +
> +	case FB_VISUAL_STATIC_PSEUDOCOLOR:
> +	case FB_VISUAL_PSEUDOCOLOR:
> +		break;
> +	}
> +
> +	return ret;
> +}
> +
> +static int mxsfb_blank(int blank, struct fb_info *fb_info)
> +{
> +	struct mxsfb_info *host = to_imxfb_host(fb_info);
> +
> +	switch (blank) {
> +	case FB_BLANK_POWERDOWN:
> +	case FB_BLANK_VSYNC_SUSPEND:
> +	case FB_BLANK_HSYNC_SUSPEND:
> +	case FB_BLANK_NORMAL:
> +		if (host->enabled)
> +			mxsfb_disable_controller(fb_info);
> +		break;
> +
> +	case FB_BLANK_UNBLANK:
> +		if (!host->enabled)
> +			mxsfb_enable_controller(fb_info);
> +		break;
> +	}
> +	return 0;
> +}
> +
> +static int mxsfb_pan_display(struct fb_var_screeninfo *var,
> +		struct fb_info *fb_info)
> +{
> +	struct mxsfb_info *host = to_imxfb_host(fb_info);
> +	unsigned offset;
> +
> +	if (var->xoffset != 0)
> +		return -EINVAL;
> +
> +	offset = fb_info->fix.line_length * var->yoffset;
> +
> +	/* update on next VSYNC */
> +	writel(fb_info->fix.smem_start + offset,
> +			host->base + host->devdata->next_buf);
> +
> +	return 0;
> +}
> +
> +static struct fb_ops mxsfb_ops = {
> +	.owner = THIS_MODULE,
> +	.fb_check_var = mxsfb_check_var,
> +	.fb_set_par = mxsfb_set_par,
> +	.fb_setcolreg = mxsfb_setcolreg,
> +	.fb_blank = mxsfb_blank,
> +	.fb_pan_display = mxsfb_pan_display,
> +	.fb_fillrect = cfb_fillrect,
> +	.fb_copyarea = cfb_copyarea,
> +	.fb_imageblit = cfb_imageblit,
> +};
> +
> +static int __devinit mxsfb_restore_mode(struct mxsfb_info *host)
> +{
> +	struct fb_info *fb_info = &host->fb_info;
> +	unsigned line_count;
> +	unsigned period;
> +	unsigned long pa, fbsize;
> +	int bits_per_pixel, ofs;
> +	u32 transfer_count, vdctrl0, vdctrl2, vdctrl3, vdctrl4, ctrl;
> +	struct fb_videomode vmode;
> +
> +	/* Only restore the mode when the controller is running */
> +	ctrl = readl(host->base + LCDC_CTRL);
> +	if (!(ctrl & CTRL_RUN))
> +		return -EINVAL;
> +
> +	vdctrl0 = readl(host->base + LCDC_VDCTRL0);
> +	vdctrl2 = readl(host->base + LCDC_VDCTRL2);
> +	vdctrl3 = readl(host->base + LCDC_VDCTRL3);
> +	vdctrl4 = readl(host->base + LCDC_VDCTRL4);
> +
> +	transfer_count = readl(host->base + host->devdata->transfer_count);
> +
> +	vmode.xres = TRANSFER_COUNT_GET_HCOUNT(transfer_count);
> +	vmode.yres = TRANSFER_COUNT_GET_VCOUNT(transfer_count);
> +
> +	switch (CTRL_GET_WORD_LENGTH(ctrl)) {
> +	case 0:
> +		bits_per_pixel = 16;
> +		break;
> +	case 3:
> +		bits_per_pixel = 32;
> +	case 1:
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	fb_info->var.bits_per_pixel = bits_per_pixel;
> +
> +	vmode.pixclock = KHZ2PICOS(clk_get_rate(host->clk) / 1000U);
> +	vmode.hsync_len = get_hsync_pulse_width(host, vdctrl2);
> +	vmode.left_margin = GET_HOR_WAIT_CNT(vdctrl3) - vmode.hsync_len;
> +	vmode.right_margin = VDCTRL2_GET_HSYNC_PERIOD(vdctrl2) - vmode.hsync_len -
> +		vmode.left_margin - vmode.xres;
> +	vmode.vsync_len = VDCTRL0_GET_VSYNC_PULSE_WIDTH(vdctrl0);
> +	period = readl(host->base + LCDC_VDCTRL1);
> +	vmode.upper_margin = GET_VERT_WAIT_CNT(vdctrl3) - vmode.vsync_len;
> +	vmode.lower_margin = period - vmode.vsync_len - vmode.upper_margin - vmode.yres;
> +
> +	vmode.vmode = FB_VMODE_NONINTERLACED;
> +
> +	vmode.sync = 0;
> +	if (vdctrl0 & VDCTRL0_HSYNC_ACT_HIGH)
> +		vmode.sync |= FB_SYNC_HOR_HIGH_ACT;
> +	if (vdctrl0 & VDCTRL0_VSYNC_ACT_HIGH)
> +		vmode.sync |= FB_SYNC_VERT_HIGH_ACT;
> +
> +	pr_debug("Reconstructed video mode:\n");
> +	pr_debug("%dx%d, hsync: %u left: %u, right: %u, vsync: %u, upper: %u, lower: %u\n",
> +			vmode.xres, vmode.yres,
> +			vmode.hsync_len, vmode.left_margin, vmode.right_margin,
> +			vmode.vsync_len, vmode.upper_margin, vmode.lower_margin);
> +	pr_debug("pixclk: %ldkHz\n", PICOS2KHZ(vmode.pixclock));
> +
> +	fb_add_videomode(&vmode, &fb_info->modelist);
> +
> +	host->ld_intf_width = CTRL_GET_BUS_WIDTH(ctrl);
> +	host->dotclk_delay = VDCTRL4_GET_DOTCLK_DLY(vdctrl4);
> +
> +	fb_info->fix.line_length = vmode.xres * (bits_per_pixel >> 3);
> +
> +	pa = readl(host->base + host->devdata->cur_buf);
> +	fbsize = fb_info->fix.line_length * vmode.yres;
> +	if (pa < fb_info->fix.smem_start)
> +		return -EINVAL;
> +	if (pa + fbsize > fb_info->fix.smem_start + fb_info->fix.smem_len)
> +		return -EINVAL;
> +	ofs = pa - fb_info->fix.smem_start;
> +	if (ofs) {
> +		memmove(fb_info->screen_base, fb_info->screen_base + ofs, fbsize);
> +		writel(fb_info->fix.smem_start, host->base + host->devdata->next_buf);
> +	}
> +
> +	line_count = fb_info->fix.smem_len / fb_info->fix.line_length;
> +	fb_info->fix.ypanstep = 1;
> +
> +	clk_enable(host->clk);
> +	host->enabled = 1;
> +
> +	return 0;
> +}
> +
> +static int __devinit mxsfb_init_fbinfo(struct mxsfb_info *host)
> +{
> +	struct fb_info *fb_info = &host->fb_info;
> +	struct fb_var_screeninfo *var = &fb_info->var;
> +	struct mxsfb_platform_data *pdata = host->pdev->dev.platform_data;
> +	dma_addr_t fb_phys;
> +	void *fb_virt;
> +	unsigned fb_size = pdata->fb_size;
> +
> +	fb_info->fbops = &mxsfb_ops;
> +	fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST;
> +	strlcpy(fb_info->fix.id, "mxs", sizeof(fb_info->fix.id));
> +	fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
> +	fb_info->fix.ypanstep = 1;
> +	fb_info->fix.visual = FB_VISUAL_TRUECOLOR,
> +	fb_info->fix.accel = FB_ACCEL_NONE;
> +
> +	var->bits_per_pixel = pdata->default_bpp ? pdata->default_bpp : 16;
> +	var->nonstd = 0;
> +	var->activate = FB_ACTIVATE_NOW;
> +	var->accel_flags = 0;
> +	var->vmode = FB_VMODE_NONINTERLACED;
> +
> +	host->dotclk_delay = pdata->dotclk_delay;
> +	host->ld_intf_width = pdata->ld_intf_width;
> +
> +	/* Memory allocation for framebuffer */
> +	if (pdata->fb_phys) {
> +		if (!fb_size)
> +			return -EINVAL;
> +
> +		fb_phys = pdata->fb_phys;
> +
> +		if (!request_mem_region(fb_phys, fb_size, host->pdev->name))
> +			return -ENOMEM;
> +
> +		fb_virt = ioremap(fb_phys, fb_size);
> +		if (!fb_virt) {
> +			release_mem_region(fb_phys, fb_size);
> +			return -ENOMEM;
> +		}
> +		host->mapped = 1;
> +	} else {
> +		if (!fb_size)
> +			fb_size = SZ_2M; /* default */
> +		fb_virt = alloc_pages_exact(fb_size, GFP_DMA);
> +		if (!fb_info->screen_base)
> +			return -ENOMEM;
> +
> +		fb_phys = virt_to_phys(fb_virt);
> +	}
> +
> +	fb_info->fix.smem_start = fb_phys;
> +	fb_info->screen_base = fb_virt;
> +	fb_info->screen_size = fb_info->fix.smem_len = fb_size;
> +
> +	if (mxsfb_restore_mode(host))
> +		memset(fb_virt, 0, fb_size);
> +
> +	return 0;
> +}
> +
> +static void __devexit mxsfb_free_videomem(struct mxsfb_info *host)
> +{
> +	struct fb_info *fb_info = &host->fb_info;
> +
> +	if (host->mapped) {
> +		iounmap(fb_info->screen_base);
> +		release_mem_region(fb_info->fix.smem_start,
> +				fb_info->screen_size);
> +	} else {
> +		free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len);
> +	}
> +}
> +
> +static int __devinit mxsfb_probe(struct platform_device *pdev)
> +{
> +	struct mxsfb_platform_data *pdata = pdev->dev.platform_data;
> +	struct resource *res;
> +	struct mxsfb_info *host;
> +	struct fb_info *fb_info;
> +	struct fb_modelist *modelist;
> +	int i, ret;
> +
> +	if (!pdata) {
> +		dev_err(&pdev->dev, "No platformdata. Giving up\n");
> +		return -ENODEV;
> +	}
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!res) {
> +		dev_err(&pdev->dev, "Cannot get memory IO resource\n");
> +		return -ENODEV;
> +	}
> +
> +	if (!request_mem_region(res->start, resource_size(res), pdev->name))
> +		return -EBUSY;
> +
> +	fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev);
> +	if (!fb_info) {
> +		dev_err(&pdev->dev, "Failed to allocate fbdev\n");
> +		ret = -ENOMEM;
> +		goto error_alloc_info;
> +	}
> +
> +	host = to_imxfb_host(fb_info);
> +
> +	host->base = ioremap(res->start, resource_size(res));
> +	if (!host->base) {
> +		dev_err(&pdev->dev, "ioremap failed\n");
> +		ret = -ENOMEM;
> +		goto error_ioremap;
> +	}
> +
> +	host->pdev = pdev;
> +	platform_set_drvdata(pdev, host);
> +
> +	host->devdata = &mxsfb_devdata[pdev->id_entry->driver_data];
> +
> +	host->clk = clk_get(&host->pdev->dev, NULL);
> +	if (IS_ERR(host->clk)) {
> +		ret = PTR_ERR(host->clk);
> +		goto error_getclock;
> +	}
> +
> +	fb_info->pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL);
> +	if (!fb_info->pseudo_palette) {
> +		ret = -ENOMEM;
> +		goto error_pseudo_pallette;
> +	}
> +
> +	INIT_LIST_HEAD(&fb_info->modelist);
> +
> +	ret = mxsfb_init_fbinfo(host);
> +	if (ret != 0)
> +		goto error_init_fb;
> +
> +	for (i = 0; i < pdata->mode_count; i++)
> +		fb_add_videomode(&pdata->mode_list[i], &fb_info->modelist);
> +
> +	modelist = list_first_entry(&fb_info->modelist,
> +			struct fb_modelist, list);
> +	fb_videomode_to_var(&fb_info->var, &modelist->mode);
> +
> +	/* init the color fields */
> +	mxsfb_check_var(&fb_info->var, fb_info);
> +
> +	platform_set_drvdata(pdev, fb_info);
> +
> +	ret = register_framebuffer(fb_info);
> +	if (ret != 0) {
> +		dev_err(&pdev->dev,"Failed to register framebuffer\n");
> +		goto error_register;
> +	}
> +
> +	if (!host->enabled) {
> +		writel(0, host->base + LCDC_CTRL);
> +		mxsfb_set_par(fb_info);
> +		mxsfb_enable_controller(fb_info);
> +	}
> +
> +	return 0;
> +
> +error_register:
> +	if (host->enabled)
> +		clk_disable(host->clk);
> +	fb_destroy_modelist(&fb_info->modelist);
> +error_init_fb:
> +	kfree(fb_info->pseudo_palette);
> +error_pseudo_pallette:
> +	clk_put(host->clk);
> +error_getclock:
> +	iounmap(host->base);
> +error_ioremap:
> +	framebuffer_release(fb_info);
> +error_alloc_info:
> +	release_mem_region(res->start, resource_size(res));
> +
> +	return ret;
> +}
> +
> +static int __devexit mxsfb_remove(struct platform_device *pdev)
> +{
> +	struct fb_info *fb_info = platform_get_drvdata(pdev);
> +	struct mxsfb_info *host = to_imxfb_host(fb_info);
> +	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +
> +	if (host->enabled)
> +		mxsfb_disable_controller(fb_info);
> +
> +	unregister_framebuffer(fb_info);
> +	kfree(fb_info->pseudo_palette);
> +	mxsfb_free_videomem(host);
> +	iounmap(host->base);
> +	clk_put(host->clk);
> +
> +	framebuffer_release(fb_info);
> +	release_mem_region(res->start, resource_size(res));
> +
> +	platform_set_drvdata(pdev, NULL);
> +
> +	return 0;
> +}
> +
> +static struct platform_device_id mxsfb_devtype[] = {
> +	{
> +		.name = "imx23-fb",
> +		.driver_data = MXSFB_MX23,
> +	}, {
> +		.name = "imx28-fb",
> +		.driver_data = MXSFB_MX28,
> +	}, {
> +	},
> +};
> +MODULE_DEVICE_TABLE(platform, mxsfb_devtype);
> +
> +static struct platform_driver mxsfb_driver = {
> +	.probe = mxsfb_probe,
> +	.remove = __devexit_p(mxsfb_remove),
> +	.id_table = mxsfb_devtype,
> +	.driver = {
> +		   .name = DRIVER_NAME,
> +	},
> +};
> +
> +static int __init mxsfb_init(void)
> +{
> +	return platform_driver_register(&mxsfb_driver);
> +}
> +
> +static void __exit mxsfb_exit(void)
> +{
> +	platform_driver_unregister(&mxsfb_driver);
> +}
> +
> +module_init(mxsfb_init);
> +module_exit(mxsfb_exit);
> +
> +MODULE_DESCRIPTION("Freescale mxs framebuffer driver");
> +MODULE_AUTHOR("Sascha Hauer, Pengutronix");
> +MODULE_LICENSE("GPL");
> -- 
> 1.7.2.3
> 
> 

^ permalink raw reply

* [PATCH] OMAP4:Fix -EINVAL for vana, vcxio, vdac
From: Krishnamoorthy, Balaji T @ 2011-02-18  5:18 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1297092599-428-1-git-send-email-balajitk@ti.com>

On Mon, Feb 7, 2011 at 8:59 PM, Balaji T K <balajitk@ti.com> wrote:
> Fixed regulators in twl6030 do not have set_voltage hook.
> Regulator core returns -22 if set_voltage is NULL and apply_uV is set
> while applying the constraint to set voltage resulting in failure during probe
> of these regulators.
> Do not set apply_uV for fixed regulators which don't have set_voltage.

Hi Tony,

Any comments on this patch.
If not can you queue this.

>
> machine_constraints_voltage: VANA: failed to apply 2100000uV constraint
> twl_reg twl_reg.43: can't register VANA, -22
> twl_reg: probe of twl_reg.43 failed with error -22
> machine_constraints_voltage: VCXIO: failed to apply 1800000uV constraint
> twl_reg twl_reg.44: can't register VCXIO, -22
> twl_reg: probe of twl_reg.44 failed with error -22
> machine_constraints_voltage: VDAC: failed to apply 1800000uV constraint
> twl_reg twl_reg.45: can't register VDAC, -22
> twl_reg: probe of twl_reg.45 failed with error -22
>
> Signed-off-by: Balaji T K <balajitk@ti.com>
> ---
> Boot tested on OMAP4SDP with omap2plus_defconfig
>
> ?arch/arm/mach-omap2/board-4430sdp.c ? ?| ? ?3 ---
> ?arch/arm/mach-omap2/board-omap4panda.c | ? ?3 ---
> ?2 files changed, 0 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
> index 07d1b20..1b16525 100644
> --- a/arch/arm/mach-omap2/board-4430sdp.c
> +++ b/arch/arm/mach-omap2/board-4430sdp.c
> @@ -434,7 +434,6 @@ static struct regulator_init_data sdp4430_vana = {
> ? ? ? ?.constraints = {
> ? ? ? ? ? ? ? ?.min_uV ? ? ? ? ? ? ? ? = 2100000,
> ? ? ? ? ? ? ? ?.max_uV ? ? ? ? ? ? ? ? = 2100000,
> - ? ? ? ? ? ? ? .apply_uV ? ? ? ? ? ? ? = true,
> ? ? ? ? ? ? ? ?.valid_modes_mask ? ? ? = REGULATOR_MODE_NORMAL
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| REGULATOR_MODE_STANDBY,
> ? ? ? ? ? ? ? ?.valid_ops_mask ?= REGULATOR_CHANGE_MODE
> @@ -446,7 +445,6 @@ static struct regulator_init_data sdp4430_vcxio = {
> ? ? ? ?.constraints = {
> ? ? ? ? ? ? ? ?.min_uV ? ? ? ? ? ? ? ? = 1800000,
> ? ? ? ? ? ? ? ?.max_uV ? ? ? ? ? ? ? ? = 1800000,
> - ? ? ? ? ? ? ? .apply_uV ? ? ? ? ? ? ? = true,
> ? ? ? ? ? ? ? ?.valid_modes_mask ? ? ? = REGULATOR_MODE_NORMAL
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| REGULATOR_MODE_STANDBY,
> ? ? ? ? ? ? ? ?.valid_ops_mask ?= REGULATOR_CHANGE_MODE
> @@ -458,7 +456,6 @@ static struct regulator_init_data sdp4430_vdac = {
> ? ? ? ?.constraints = {
> ? ? ? ? ? ? ? ?.min_uV ? ? ? ? ? ? ? ? = 1800000,
> ? ? ? ? ? ? ? ?.max_uV ? ? ? ? ? ? ? ? = 1800000,
> - ? ? ? ? ? ? ? .apply_uV ? ? ? ? ? ? ? = true,
> ? ? ? ? ? ? ? ?.valid_modes_mask ? ? ? = REGULATOR_MODE_NORMAL
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| REGULATOR_MODE_STANDBY,
> ? ? ? ? ? ? ? ?.valid_ops_mask ?= REGULATOR_CHANGE_MODE
> diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
> index e001a04..3686533 100644
> --- a/arch/arm/mach-omap2/board-omap4panda.c
> +++ b/arch/arm/mach-omap2/board-omap4panda.c
> @@ -305,7 +305,6 @@ static struct regulator_init_data omap4_panda_vana = {
> ? ? ? ?.constraints = {
> ? ? ? ? ? ? ? ?.min_uV ? ? ? ? ? ? ? ? = 2100000,
> ? ? ? ? ? ? ? ?.max_uV ? ? ? ? ? ? ? ? = 2100000,
> - ? ? ? ? ? ? ? .apply_uV ? ? ? ? ? ? ? = true,
> ? ? ? ? ? ? ? ?.valid_modes_mask ? ? ? = REGULATOR_MODE_NORMAL
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| REGULATOR_MODE_STANDBY,
> ? ? ? ? ? ? ? ?.valid_ops_mask ?= REGULATOR_CHANGE_MODE
> @@ -317,7 +316,6 @@ static struct regulator_init_data omap4_panda_vcxio = {
> ? ? ? ?.constraints = {
> ? ? ? ? ? ? ? ?.min_uV ? ? ? ? ? ? ? ? = 1800000,
> ? ? ? ? ? ? ? ?.max_uV ? ? ? ? ? ? ? ? = 1800000,
> - ? ? ? ? ? ? ? .apply_uV ? ? ? ? ? ? ? = true,
> ? ? ? ? ? ? ? ?.valid_modes_mask ? ? ? = REGULATOR_MODE_NORMAL
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| REGULATOR_MODE_STANDBY,
> ? ? ? ? ? ? ? ?.valid_ops_mask ?= REGULATOR_CHANGE_MODE
> @@ -329,7 +327,6 @@ static struct regulator_init_data omap4_panda_vdac = {
> ? ? ? ?.constraints = {
> ? ? ? ? ? ? ? ?.min_uV ? ? ? ? ? ? ? ? = 1800000,
> ? ? ? ? ? ? ? ?.max_uV ? ? ? ? ? ? ? ? = 1800000,
> - ? ? ? ? ? ? ? .apply_uV ? ? ? ? ? ? ? = true,
> ? ? ? ? ? ? ? ?.valid_modes_mask ? ? ? = REGULATOR_MODE_NORMAL
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| REGULATOR_MODE_STANDBY,
> ? ? ? ? ? ? ? ?.valid_ops_mask ?= REGULATOR_CHANGE_MODE
> --
> 1.7.0.4
>
>

^ permalink raw reply

* [PATCH RESEND 4/4] ARM: imx50: correct iomux-mx50.h wrong daisy chain settings
From: Richard Zhao @ 2011-02-18  4:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298003777-7687-1-git-send-email-richard.zhao@freescale.com>

Most fix is for uart txd/cts. They don't need to select input.
And fix some other pads with wrong select input.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>

diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx50.h b/arch/arm/plat-mxc/include/mach/iomux-mx50.h
index 058a922..98e7fd0 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx50.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx50.h
@@ -86,7 +86,7 @@
 #define MX50_PAD_I2C1_SCL__I2C1_SCL	IOMUX_PAD(0x2EC, 0x40, IOMUX_CONFIG_SION, 0x0, 0, \
 							MX50_I2C_PAD_CTRL)
 #define MX50_PAD_I2C1_SCL__GPIO_6_18	IOMUX_PAD(0x2EC, 0x40, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C1_SCL__UART2_TXD	IOMUX_PAD(0x2EC, 0x40, 2, 0x7cc, 0, MX50_UART_PAD_CTRL)
+#define MX50_PAD_I2C1_SCL__UART2_TXD	IOMUX_PAD(0x2EC, 0x40, 2, 0x0, 0, MX50_UART_PAD_CTRL)
 
 #define MX50_PAD_I2C1_SDA__I2C1_SDA	IOMUX_PAD(0x2F0, 0x44, IOMUX_CONFIG_SION, 0x0, 0, \
 							MX50_I2C_PAD_CTRL)
@@ -96,7 +96,7 @@
 #define MX50_PAD_I2C2_SCL__I2C2_SCL	IOMUX_PAD(0x2F4, 0x48, IOMUX_CONFIG_SION, 0x0, 0, \
 							MX50_I2C_PAD_CTRL)
 #define MX50_PAD_I2C2_SCL__GPIO_6_20	IOMUX_PAD(0x2F4, 0x48, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C2_SCL__UART2_CTS	IOMUX_PAD(0x2F4, 0x48, 2, 0x7c8, 0, MX50_UART_PAD_CTRL)
+#define MX50_PAD_I2C2_SCL__UART2_CTS	IOMUX_PAD(0x2F4, 0x48, 2, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_I2C2_SCL__DCDC_OK	IOMUX_PAD(0x2F4, 0x48, 7, 0x0, 0, NO_PAD_CTRL)
 
 #define MX50_PAD_I2C2_SDA__I2C2_SDA	IOMUX_PAD(0x2F8, 0x4C, IOMUX_CONFIG_SION, 0x0, 0, \
@@ -172,7 +172,7 @@
 
 #define MX50_PAD_SSI_RXFS__AUD3_RXFS	IOMUX_PAD(0x328, 0x7C, 0, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_SSI_RXFS__GPIO_6_4	IOMUX_PAD(0x328, 0x7C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXFS__UART5_TXD	IOMUX_PAD(0x328, 0x7C, 2, 0x7e4, 0, MX50_UART_PAD_CTRL)
+#define MX50_PAD_SSI_RXFS__UART5_TXD	IOMUX_PAD(0x328, 0x7C, 2, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_SSI_RXFS__WEIM_D6	IOMUX_PAD(0x328, 0x7C, 3, 0x804, 0, NO_PAD_CTRL)
 #define MX50_PAD_SSI_RXFS__CSPI_SS2	IOMUX_PAD(0x328, 0x7C, 4, 0x6f0, 0, MX50_CSPI_SS_PAD)
 #define MX50_PAD_SSI_RXFS__FEC_COL	IOMUX_PAD(0x328, 0x7C, 5, 0x770, 0, PAD_CTL_DSE_HIGH)
@@ -186,25 +186,25 @@
 #define MX50_PAD_SSI_RXC__FEC_RX_CLK	IOMUX_PAD(0x32C, 0x80, 5, 0x780, 0, NO_PAD_CTRL)
 #define MX50_PAD_SSI_RXC__FEC_MDIO	IOMUX_PAD(0x32C, 0x80, 6, 0x774, 1, MX50_FEC_PAD_CTRL)
 
-#define MX50_PAD_UART1_TXD__UART1_TXD	IOMUX_PAD(0x330, 0x84, 0, 0x7c4, 0, MX50_UART_PAD_CTRL)
+#define MX50_PAD_UART1_TXD__UART1_TXD	IOMUX_PAD(0x330, 0x84, 0, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART1_TXD__GPIO_6_6	IOMUX_PAD(0x330, 0x84, 1, 0x0, 0, NO_PAD_CTRL)
 
 #define MX50_PAD_UART1_RXD__UART1_RXD	IOMUX_PAD(0x334, 0x88, 0, 0x7c4, 1, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART1_RXD__GPIO_6_7	IOMUX_PAD(0x334, 0x88, 1, 0x0, 0, NO_PAD_CTRL)
 
-#define MX50_PAD_UART1_CTS__UART1_CTS	IOMUX_PAD(0x338, 0x8C, 0, 0x7c0, 0, MX50_UART_PAD_CTRL)
+#define MX50_PAD_UART1_CTS__UART1_CTS	IOMUX_PAD(0x338, 0x8C, 0, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART1_CTS__GPIO_6_8	IOMUX_PAD(0x338, 0x8C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART1_CTS__UART5_TXD	IOMUX_PAD(0x338, 0x8C, 2, 0x7e4, 2, MX50_UART_PAD_CTRL)
+#define MX50_PAD_UART1_CTS__UART5_TXD	IOMUX_PAD(0x338, 0x8C, 2, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART1_CTS__SD4_D4	IOMUX_PAD(0x338, 0x8C, 4, 0x760, 0, MX50_SD_PAD_CTRL)
 #define MX50_PAD_UART1_CTS__SD4_CMD	IOMUX_PAD(0x338, 0x8C, 5, 0x74c, 0, MX50_SD_PAD_CTRL)
 
 #define MX50_PAD_UART1_RTS__UART1_RTS	IOMUX_PAD(0x33C, 0x90, 0, 0x7c0, 1, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART1_RTS__GPIO_6_9	IOMUX_PAD(0x33C, 0x90, 1, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_UART1_RTS__UART5_RXD	IOMUX_PAD(0x33C, 0x90, 2, 0x7e4, 3, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART1_RTS__SD4_D5	IOMUX_PAD(0x33C, 0x90, 4, 0x0, 1, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART1_RTS__SD4_CLK	IOMUX_PAD(0x33C, 0x90, 5, 0x0, 1, MX50_SD_PAD_CTRL)
+#define MX50_PAD_UART1_RTS__SD4_D5	IOMUX_PAD(0x33C, 0x90, 4, 0x764, 0, MX50_SD_PAD_CTRL)
+#define MX50_PAD_UART1_RTS__SD4_CLK	IOMUX_PAD(0x33C, 0x90, 5, 0x748, 0, MX50_SD_PAD_CTRL)
 
-#define MX50_PAD_UART2_TXD__UART2_TXD	IOMUX_PAD(0x340, 0x94, 0, 0x7cc, 2, MX50_UART_PAD_CTRL)
+#define MX50_PAD_UART2_TXD__UART2_TXD	IOMUX_PAD(0x340, 0x94, 0, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART2_TXD__GPIO_6_10	IOMUX_PAD(0x340, 0x94, 1, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_UART2_TXD__SD4_D6	IOMUX_PAD(0x340, 0x94, 4, 0x768, 0, MX50_SD_PAD_CTRL)
 #define MX50_PAD_UART2_TXD__SD4_D4	IOMUX_PAD(0x340, 0x94, 5, 0x760, 1, MX50_SD_PAD_CTRL)
@@ -214,7 +214,7 @@
 #define MX50_PAD_UART2_RXD__SD4_D7	IOMUX_PAD(0x344, 0x98, 4, 0x76c, 0, MX50_SD_PAD_CTRL)
 #define MX50_PAD_UART2_RXD__SD4_D5	IOMUX_PAD(0x344, 0x98, 5, 0x764, 1, MX50_SD_PAD_CTRL)
 
-#define MX50_PAD_UART2_CTS__UART2_CTS	IOMUX_PAD(0x348, 0x9C, 0, 0x7c8, 2, MX50_UART_PAD_CTRL)
+#define MX50_PAD_UART2_CTS__UART2_CTS	IOMUX_PAD(0x348, 0x9C, 0, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART2_CTS__GPIO_6_12	IOMUX_PAD(0x348, 0x9C, 1, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_UART2_CTS__SD4_CMD	IOMUX_PAD(0x348, 0x9C, 4, 0x74c, 1, MX50_SD_PAD_CTRL)
 #define MX50_PAD_UART2_CTS__SD4_D6	IOMUX_PAD(0x348, 0x9C, 5, 0x768, 1, MX50_SD_PAD_CTRL)
@@ -224,7 +224,7 @@
 #define MX50_PAD_UART2_RTS__SD4_CLK	IOMUX_PAD(0x34C, 0xA0, 4, 0x748, 1, MX50_SD_PAD_CTRL)
 #define MX50_PAD_UART2_RTS__SD4_D7	IOMUX_PAD(0x34C, 0xA0, 5, 0x76c, 1, MX50_SD_PAD_CTRL)
 
-#define MX50_PAD_UART3_TXD__UART3_TXD	IOMUX_PAD(0x350, 0xA4, 0, 0x7d4, 0, MX50_UART_PAD_CTRL)
+#define MX50_PAD_UART3_TXD__UART3_TXD	IOMUX_PAD(0x350, 0xA4, 0, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART3_TXD__GPIO_6_14	IOMUX_PAD(0x350, 0xA4, 1, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_UART3_TXD__SD1_D4	IOMUX_PAD(0x350, 0xA4, 3, 0x0, 0, MX50_SD_PAD_CTRL)
 #define MX50_PAD_UART3_TXD__SD4_D0	IOMUX_PAD(0x350, 0xA4, 4, 0x750, 0, MX50_SD_PAD_CTRL)
@@ -238,9 +238,9 @@
 #define MX50_PAD_UART3_RXD__SD2_CD	IOMUX_PAD(0x354, 0xA8, 5, 0x740, 0, MX50_SD_PAD_CTRL)
 #define MX50_PAD_UART3_RXD__WEIM_D13	IOMUX_PAD(0x354, 0xA8, 6, 0x820, 0, NO_PAD_CTRL)
 
-#define MX50_PAD_UART4_TXD__UART4_TXD	IOMUX_PAD(0x358, 0xAC, 0, 0x7dc, 0, MX50_UART_PAD_CTRL)
+#define MX50_PAD_UART4_TXD__UART4_TXD	IOMUX_PAD(0x358, 0xAC, 0, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART4_TXD__GPIO_6_16	IOMUX_PAD(0x358, 0xAC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART4_TXD__UART3_CTS	IOMUX_PAD(0x358, 0xAC, 2, 0x7d0, 0, MX50_UART_PAD_CTRL)
+#define MX50_PAD_UART4_TXD__UART3_CTS	IOMUX_PAD(0x358, 0xAC, 2, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_UART4_TXD__SD1_D6	IOMUX_PAD(0x358, 0xAC, 3, 0x0, 0, MX50_SD_PAD_CTRL)
 #define MX50_PAD_UART4_TXD__SD4_D2	IOMUX_PAD(0x358, 0xAC, 4, 0x758, 0, MX50_SD_PAD_CTRL)
 #define MX50_PAD_UART4_TXD__SD2_LCTL	IOMUX_PAD(0x358, 0xAC, 5, 0x0, 0, MX50_SD_PAD_CTRL)
@@ -278,7 +278,7 @@
 #define MX50_PAD_ECSPI1_MOSI__GPIO_4_13		IOMUX_PAD(0x374, 0xC8, 1, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI1_MOSI__CSPI_SS1		IOMUX_PAD(0x374, 0xC8, 2, 0x6ec, 1, MX50_CSPI_SS_PAD)
 #define MX50_PAD_ECSPI1_MOSI__ECSPI2_SS1	IOMUX_PAD(0x374, 0xC8, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI1_MOSI__UART3_CTS		IOMUX_PAD(0x374, 0xC8, 4, 0x7d0, 3, MX50_UART_PAD_CTRL)
+#define MX50_PAD_ECSPI1_MOSI__UART3_CTS		IOMUX_PAD(0x374, 0xC8, 4, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_ECSPI1_MOSI__EPDC_SDCE7	IOMUX_PAD(0x374, 0xC8, 5, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI1_MOSI__WEIM_D9		IOMUX_PAD(0x374, 0xC8, 7, 0x810, 0, NO_PAD_CTRL)
 
@@ -294,7 +294,7 @@
 #define MX50_PAD_ECSPI1_SS0__GPIO_4_15		IOMUX_PAD(0x37C, 0xD0, 1, 0x0, 0, PAD_CTL_PUS_100K_UP)
 #define MX50_PAD_ECSPI1_SS0__CSPI_SS3		IOMUX_PAD(0x37C, 0xD0, 2, 0x6f4, 1, MX50_CSPI_SS_PAD)
 #define MX50_PAD_ECSPI1_SS0__ECSPI2_SS3		IOMUX_PAD(0x37C, 0xD0, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI1_SS0__UART4_CTS		IOMUX_PAD(0x37C, 0xD0, 4, 0x7d8, 1, MX50_UART_PAD_CTRL)
+#define MX50_PAD_ECSPI1_SS0__UART4_CTS		IOMUX_PAD(0x37C, 0xD0, 4, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_ECSPI1_SS0__EPDC_SDCE9		IOMUX_PAD(0x37C, 0xD0, 5, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI1_SS0__WEIM_D11		IOMUX_PAD(0x37C, 0xD0, 7, 0x818, 0, NO_PAD_CTRL)
 
@@ -311,17 +311,17 @@
 #define MX50_PAD_ECSPI2_MOSI__GPIO_4_17		IOMUX_PAD(0x384, 0xD8, 1, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI2_MOSI__ELCDIF_RD		IOMUX_PAD(0x384, 0xD8, 2, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI2_MOSI__ECSPI1_SS1	IOMUX_PAD(0x384, 0xD8, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI2_MOSI__UART5_CTS		IOMUX_PAD(0x384, 0xD8, 4, 0x7e0, 1, MX50_UART_PAD_CTRL)
+#define MX50_PAD_ECSPI2_MOSI__UART5_CTS		IOMUX_PAD(0x384, 0xD8, 4, 0x0, 0, MX50_UART_PAD_CTRL)
 #define MX50_PAD_ECSPI2_MOSI__ELCDIF_EN		IOMUX_PAD(0x384, 0xD8, 5, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI2_MOSI__NANDF_CEN5	IOMUX_PAD(0x384, 0xD8, 6, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI2_MOSI__WEIM_D9		IOMUX_PAD(0x384, 0xD8, 7, 0x810, 1, NO_PAD_CTRL)
 
-#define MX50_PAD_ECSPI2_MISO__ECSPI2_MISO	IOMUX_PAD(0x388, 0xDC, 0, 0x73c, 0, NO_PAD_CTRL)
+#define MX50_PAD_ECSPI2_MISO__ECSPI2_MISO	IOMUX_PAD(0x388, 0xDC, 0, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI2_MISO__GPIO_4_18		IOMUX_PAD(0x388, 0xDC, 1, 0x0, 0, PAD_CTL_PUS_100K_UP)
 #define MX50_PAD_ECSPI2_MISO__ELCDIF_RS		IOMUX_PAD(0x388, 0xDC, 2, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI2_MISO__ECSPI1_SS2	IOMUX_PAD(0x388, 0xDC, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI2_MISO__UART5_TXD		IOMUX_PAD(0x388, 0xDC, 4, 0x7e4, 4, MX50_UART_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MISO__ELCDIF_VSYNC	IOMUX_PAD(0x388, 0xDC, 5, 0x0, 0, NO_PAD_CTRL)
+#define MX50_PAD_ECSPI2_MISO__UART5_TXD		IOMUX_PAD(0x388, 0xDC, 4, 0x0, 0, MX50_UART_PAD_CTRL)
+#define MX50_PAD_ECSPI2_MISO__ELCDIF_VSYNC	IOMUX_PAD(0x388, 0xDC, 5, 0x73c, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI2_MISO__NANDF_CEN6	IOMUX_PAD(0x388, 0xDC, 6, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_ECSPI2_MISO__WEIM_D10		IOMUX_PAD(0x388, 0xDC, 7, 0x814, 1, NO_PAD_CTRL)
 
@@ -503,7 +503,7 @@
 #define MX50_PAD_DISP_RD__ELCDIF_EN	IOMUX_PAD(0x430, 0x150, 2, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
 #define MX50_PAD_DISP_RD__WEIM_A25	IOMUX_PAD(0x430, 0x150, 3, 0x0, 0, NO_PAD_CTRL)
 
-#define MX50_PAD_DISP_RS__ELCDIF_RS	IOMUX_PAD(0x434, 0x154, 0, 0x73c, 1, MX50_ELCDIF_PAD_CTRL)
+#define MX50_PAD_DISP_RS__ELCDIF_RS	IOMUX_PAD(0x434, 0x154, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
 #define MX50_PAD_DISP_RS__GPIO_2_17	IOMUX_PAD(0x434, 0x154, 1, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_DISP_RS__ELCDIF_VSYNC	IOMUX_PAD(0x434, 0x154, 2, 0x73c, 1, MX50_ELCDIF_PAD_CTRL)
 #define MX50_PAD_DISP_RS__WEIM_A26	IOMUX_PAD(0x434, 0x154, 3, 0x0, 0, NO_PAD_CTRL)
@@ -691,8 +691,8 @@
 
 #define MX50_PAD_EPDC_D9__EPDC_D9	IOMUX_PAD(0x570, 0x1D4, 0, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_EPDC_D9__GPIO_3_9	IOMUX_PAD(0x570, 0x1D4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D9__WEIM_D9	IOMUX_PAD(0x570, 0x1D4, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D9__ELCDIF_D25	IOMUX_PAD(0x570, 0x1D4, 3, 0x810, 2, MX50_ELCDIF_PAD_CTRL)
+#define MX50_PAD_EPDC_D9__WEIM_D9	IOMUX_PAD(0x570, 0x1D4, 2, 0x810, 2, NO_PAD_CTRL)
+#define MX50_PAD_EPDC_D9__ELCDIF_D25	IOMUX_PAD(0x570, 0x1D4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
 
 #define MX50_PAD_EPDC_D10__EPDC_D10	IOMUX_PAD(0x574, 0x1D8, 0, 0x0, 0, NO_PAD_CTRL)
 #define MX50_PAD_EPDC_D10__GPIO_3_10	IOMUX_PAD(0x574, 0x1D8, 1, 0x0, 0, NO_PAD_CTRL)
-- 
1.7.1

^ permalink raw reply related

* [PATCH RESEND 3/4] ARM: imx53_loco: add i2c device support
From: Richard Zhao @ 2011-02-18  4:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298003777-7687-1-git-send-email-richard.zhao@freescale.com>

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>

diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index 10b6008..abea297 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -146,6 +146,7 @@ config MACH_MX53_LOCO
 	bool "Support MX53 LOCO platforms"
 	select SOC_IMX53
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_IMX_I2C
 	help
 	  Include support for MX53 LOCO platform. This includes specific
 	  configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c
index b8241bd..ec9ea9c 100644
--- a/arch/arm/mach-mx5/board-mx53_loco.c
+++ b/arch/arm/mach-mx5/board-mx53_loco.c
@@ -199,6 +199,10 @@ static struct fec_platform_data mx53_loco_fec_data = {
 	.phy = PHY_INTERFACE_MODE_RMII,
 };
 
+static const struct imxi2c_platform_data mx53_loco_i2c_data __initconst = {
+	.bitrate = 100000,
+};
+
 static void __init mx53_loco_board_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
@@ -206,6 +210,8 @@ static void __init mx53_loco_board_init(void)
 	imx53_add_imx_uart(0, NULL);
 	mx53_loco_fec_reset();
 	imx53_add_fec(&mx53_loco_fec_data);
+	imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
+	imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
 }
 
 static void __init mx53_loco_timer_init(void)
-- 
1.7.1

^ permalink raw reply related

* [PATCH RESEND 2/4] ARM: imx53_loco add uncompress print
From: Richard Zhao @ 2011-02-18  4:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298003777-7687-1-git-send-email-richard.zhao@freescale.com>

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>

diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index e634d6c..b702884 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -111,6 +111,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
 		uart_base = MX50_UART1_BASE_ADDR;
 		break;
 	case MACH_TYPE_MX53_EVK:
+	case MACH_TYPE_MX53_LOCO:
 		uart_base = MX53_UART1_BASE_ADDR;
 		break;
 	default:
-- 
1.7.1

^ permalink raw reply related

* [PATCH RESEND 1/4] ARM: imx53_loco: add all pad configure.
From: Richard Zhao @ 2011-02-18  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>

diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c
index 0fea252..b8241bd 100644
--- a/arch/arm/mach-mx5/board-mx53_loco.c
+++ b/arch/arm/mach-mx5/board-mx53_loco.c
@@ -39,8 +39,145 @@
 #define LOCO_FEC_PHY_RST		IMX_GPIO_NR(7, 6)
 
 static iomux_v3_cfg_t mx53_loco_pads[] = {
+	/* FEC */
+	MX53_PAD_FEC_MDC__FEC_MDC,
+	MX53_PAD_FEC_MDIO__FEC_MDIO,
+	MX53_PAD_FEC_REF_CLK__FEC_TX_CLK,
+	MX53_PAD_FEC_RX_ER__FEC_RX_ER,
+	MX53_PAD_FEC_CRS_DV__FEC_RX_DV,
+	MX53_PAD_FEC_RXD1__FEC_RDATA_1,
+	MX53_PAD_FEC_RXD0__FEC_RDATA_0,
+	MX53_PAD_FEC_TX_EN__FEC_TX_EN,
+	MX53_PAD_FEC_TXD1__FEC_TDATA_1,
+	MX53_PAD_FEC_TXD0__FEC_TDATA_0,
+	/* FEC_nRST */
+	MX53_PAD_PATA_DA_0__GPIO7_6,
+	/* FEC_nINT */
+	MX53_PAD_PATA_DATA4__GPIO2_4,
+	/* AUDMUX5 */
+	MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC,
+	MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD,
+	MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS,
+	MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD,
+	/* I2C2 */
+	MX53_PAD_KEY_COL3__I2C2_SCL,
+	MX53_PAD_KEY_ROW3__I2C2_SDA,
+	/* SD1 */
+	MX53_PAD_SD1_CMD__ESDHC1_CMD,
+	MX53_PAD_SD1_CLK__ESDHC1_CLK,
+	MX53_PAD_SD1_DATA0__ESDHC1_DAT0,
+	MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
+	MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
+	MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
+	/* SD3 */
+	MX53_PAD_PATA_DATA8__ESDHC3_DAT0,
+	MX53_PAD_PATA_DATA9__ESDHC3_DAT1,
+	MX53_PAD_PATA_DATA10__ESDHC3_DAT2,
+	MX53_PAD_PATA_DATA11__ESDHC3_DAT3,
+	MX53_PAD_PATA_DATA0__ESDHC3_DAT4,
+	MX53_PAD_PATA_DATA1__ESDHC3_DAT5,
+	MX53_PAD_PATA_DATA2__ESDHC3_DAT6,
+	MX53_PAD_PATA_DATA3__ESDHC3_DAT7,
+	MX53_PAD_PATA_IORDY__ESDHC3_CLK,
+	MX53_PAD_PATA_RESET_B__ESDHC3_CMD,
+	/* SD3_CD */
+	MX53_PAD_EIM_DA11__GPIO3_11,
+	/* SD3_WP */
+	MX53_PAD_EIM_DA12__GPIO3_12,
+	/* VGA */
+	MX53_PAD_EIM_OE__IPU_DI1_PIN7,
+	MX53_PAD_EIM_RW__IPU_DI1_PIN8,
+	/* DISPLB */
+	MX53_PAD_EIM_D20__IPU_SER_DISP0_CS,
+	MX53_PAD_EIM_D21__IPU_DISPB0_SER_CLK,
+	MX53_PAD_EIM_D22__IPU_DISPB0_SER_DIN,
+	MX53_PAD_EIM_D23__IPU_DI0_D0_CS,
+	/* DISP0_POWER_EN */
+	MX53_PAD_EIM_D24__GPIO3_24,
+	/* DISP0 DET INT */
+	MX53_PAD_EIM_D31__GPIO3_31,
+	/* LVDS */
+	MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3,
+	MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK,
+	MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2,
+	MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1,
+	MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0,
+	MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3,
+	MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2,
+	MX53_PAD_LVDS1_CLK_P__LDB_LVDS1_CLK,
+	MX53_PAD_LVDS1_TX1_P__LDB_LVDS1_TX1,
+	MX53_PAD_LVDS1_TX0_P__LDB_LVDS1_TX0,
+	/* I2C1 */
+	MX53_PAD_CSI0_DAT8__I2C1_SDA,
+	MX53_PAD_CSI0_DAT9__I2C1_SCL,
+	/* UART1 */
 	MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
 	MX53_PAD_CSI0_DAT11__UART1_RXD_MUX,
+	/* CSI0 */
+	MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12,
+	MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13,
+	MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14,
+	MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15,
+	MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16,
+	MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17,
+	MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18,
+	MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19,
+	MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC,
+	MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC,
+	MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK,
+	/* DISPLAY */
+	MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK,
+	MX53_PAD_DI0_PIN15__IPU_DI0_PIN15,
+	MX53_PAD_DI0_PIN2__IPU_DI0_PIN2,
+	MX53_PAD_DI0_PIN3__IPU_DI0_PIN3,
+	MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0,
+	MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1,
+	MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2,
+	MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3,
+	MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4,
+	MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5,
+	MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6,
+	MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7,
+	MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8,
+	MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9,
+	MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10,
+	MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11,
+	MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12,
+	MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13,
+	MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14,
+	MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15,
+	MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16,
+	MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17,
+	MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18,
+	MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19,
+	MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20,
+	MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21,
+	MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22,
+	MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23,
+	/* Audio CLK*/
+	MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK,
+	/* PWM */
+	MX53_PAD_GPIO_1__PWM2_PWMO,
+	/* SPDIF */
+	MX53_PAD_GPIO_7__SPDIF_PLOCK,
+	MX53_PAD_GPIO_17__SPDIF_OUT1,
+	/* GPIO */
+	MX53_PAD_PATA_DA_1__GPIO7_7,
+	MX53_PAD_PATA_DA_2__GPIO7_8,
+	MX53_PAD_PATA_DATA5__GPIO2_5,
+	MX53_PAD_PATA_DATA6__GPIO2_6,
+	MX53_PAD_PATA_DATA14__GPIO2_14,
+	MX53_PAD_PATA_DATA15__GPIO2_15,
+	MX53_PAD_PATA_INTRQ__GPIO7_2,
+	MX53_PAD_EIM_WAIT__GPIO5_0,
+	MX53_PAD_NANDF_WP_B__GPIO6_9,
+	MX53_PAD_NANDF_RB0__GPIO6_10,
+	MX53_PAD_NANDF_CS1__GPIO6_14,
+	MX53_PAD_NANDF_CS2__GPIO6_15,
+	MX53_PAD_NANDF_CS3__GPIO6_16,
+	MX53_PAD_GPIO_5__GPIO1_5,
+	MX53_PAD_GPIO_16__GPIO7_11,
+	MX53_PAD_GPIO_8__GPIO1_8,
 };
 
 static inline void mx53_loco_fec_reset(void)
-- 
1.7.1

^ permalink raw reply related

* [PATCH] i.MX23/28 framebuffer driver
From: Clark, Rob @ 2011-02-18  4:34 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <AANLkTimOUnaHNMg03cHAiNJLuGhGuMWSHt+kibxWfYMH@mail.gmail.com>

I'm in the process of adding xrandr support to our xorg driver..
definitely more built-in support on the X side would make this easier.

BR,
-R

On Thu, Feb 17, 2011 at 8:25 PM, Jammy Zhou <jammy.zhou@linaro.org> wrote:
> I also noticed that default XRandR1.2+ implementation is missing in X side.
> If we can implement one, it would be beneficial for all ARM platforms. By
> the way, does X driver of TI support XRandR1.2+?
>
> Regards,
> Jammy
>
> On Thu, Feb 17, 2011 at 11:25 PM, Clark, Rob <rob@ti.com> wrote:
>>
>> Hmm, I was thinking more on the xf86 side of things.. ie. to provide
>> default implementations of xf86CrtcFuncsRec and xf86OutputFuncsRec
>> functions..
>>
>> BR,
>> -R
>>
>> On Wed, Feb 16, 2011 at 7:24 PM, Jammy Zhou <jammy.zhou@linaro.org> wrote:
>> >
>> > There is already one KMS abstraction layer (libkms.so) in libdrm, maybe
>> > it can serve as what we needed.
>> >
>> > Regards,
>> > Jammy
>> >
>> > On Thu, Feb 17, 2011 at 9:08 AM, Clark, Rob <rob@ti.com> wrote:
>> >>
>> >> I'm still in the learning-as-I-go phase here, so definitely not ready
>> >> to propose a solution, but it does seem to me like there is room for
>> >> some sort of kms-helper library here to handle more of the boilerplate
>> >> xf86-video-* stuff.. ?I guess I'll have a better picture once I have a
>> >> chance to add support for the various multi-monitor configurations.
>> >> But certainly would be interested if anyone already has some ideas.
>> >>
>> >> BR,
>> >> -R
>> >>
>> >> On Wed, Feb 16, 2011 at 8:42 AM, Jesse Barker <jesse.barker@linaro.org>
>> >> wrote:
>> >> > Speaking for the Linaro graphics working group, I think it's great.
>> >> > And, I
>> >> > think you're right, that if enough of the KMS support in xf86-video-*
>> >> > is
>> >> > similar enough (I was only aware of intel and nouveau supporting it
>> >> > properly
>> >> > at current), pulling it out into a common layer would make it easier
>> >> > to
>> >> > support in new drivers (including fbdev).
>> >> >
>> >> > cheers,
>> >> > Jesse
>> >> >
>> >> > On Wed, Feb 16, 2011 at 4:22 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> >> >>
>> >> >> On Tuesday 15 February 2011, Clark, Rob wrote:
>> >> >> > I'd been experimenting a bit on the side w/ the DRM driver
>> >> >> > framework (
>> >> >> >
>> >> >> >
>> >> >> > http://gitorious.com/~robclark/pandaboard/robclarks-kernel-omap4/commits/omap_gpu
>> >> >> > ), but had to add a good chunk of mostly boilerplate code to our
>> >> >> > xorg
>> >> >> > driver in order just to test it. ?Maybe some generic support for
>> >> >> > KMS
>> >> >> > in xf86-video-fbdev would have made this easier to develop the
>> >> >> > kernel
>> >> >> > part without in parallel having to implement the userspace part.
>> >> >> > ?I'm
>> >> >> > not sure if this is the sort of thing the linaro-wg has in mind?
>> >> >>
>> >> >> I'm not sure what the the linaro multimedia wg thinks of this, but
>> >> >> the
>> >> >> kernel code you linked looks like it's doing exactly the right
>> >> >> thing.
>> >> >>
>> >> >> ? ? ? ?Arnd
>> >> >>
>> >> >> _______________________________________________
>> >> >> linaro-dev mailing list
>> >> >> linaro-dev at lists.linaro.org
>> >> >> http://lists.linaro.org/mailman/listinfo/linaro-dev
>> >> >
>> >> >
>> >>
>> >> _______________________________________________
>> >> linaro-dev mailing list
>> >> linaro-dev at lists.linaro.org
>> >> http://lists.linaro.org/mailman/listinfo/linaro-dev
>> >
>
>

^ permalink raw reply

* [PATCH] i.MX23/28 framebuffer driver
From: Clark, Rob @ 2011-02-18  4:32 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <AANLkTimcwr4vpycSQCH9vMaB+umh+yHD_+WD2MJNqMOB@mail.gmail.com>

I'm all for a more modular drm, although I think the framework of
CRTCs, encoders, and connectors is a nice fit, at least for our hw.
It would be nice to have a better way to expose overlays.  And I'm
still thinking about how/if GEM fits in with our various video and
2/3d accelerators.

BR,
-R

On Thu, Feb 17, 2011 at 8:19 PM, Jammy Zhou <jammy.zhou@linaro.org> wrote:
> To accommodate the fact of independent display controller and GPU components
> in ARM SOC, it will be better if we can separate KMS from DRM both in kernel
> space and user space (i.e, create a new drivers/video/kms directory for
> kernel side, move KMS related code in libdrm to libkms in user space). Then
> we can build xrandr1.2+ support based on KMS for ARM platforms, even if DRM
> is still not supported. Besides, for buffer management part (GEM) in DRM, if
> possible, we can also make it an independent module leaving DRM just a
> wrapper, so that the GEM stuff can be used more flexibly.
>
> Regards,
> Jammy
>
> On Fri, Feb 18, 2011 at 12:14 AM, James Simmons <jsimmons@infradead.org>
> wrote:
>>
>> > I'm still in the learning-as-I-go phase here, so definitely not ready
>> > to propose a solution, but it does seem to me like there is room for
>> > some sort of kms-helper library here to handle more of the boilerplate
>> > xf86-video-* stuff.. ?I guess I'll have a better picture once I have a
>> > chance to add support for the various multi-monitor configurations.
>> > But certainly would be interested if anyone already has some ideas.
>>
>> I have been thinking about this as well. One of the short coming for DRM
>> on embedded platforms is the lack of a small well defined library that one
>> could use. Right now libkms only handles buffer allocation. The mode
>> setting is currently tied to the libdrm library. It would be nice to
>> seperate the two out more. Move the mode setting code to libkms and then
>> have libdrm be a wrapper around this. This way libdrm can both support
>> the legacy drm drivers and the new kms drivers at the same time. It also
>> makes a clear seperation. Jakob if you are willing to take this work I
>> will gladly seen you patches.
>>
>> _______________________________________________
>> linaro-dev mailing list
>> linaro-dev at lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/linaro-dev
>
>

^ permalink raw reply

* [PATCH 4/4] mtd: OneNAND: OMAP2: increase multiblock erase verify timeout
From: Artem Bityutskiy @ 2011-02-18  4:31 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20110217234603.GI20795@atomide.com>

Hi,

On Thu, 2011-02-17 at 15:46 -0800, Tony Lindgren wrote:
> * Adrian Hunter <adrian.hunter@nokia.com> [110207 00:45]:
> > From: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> > 
> > The current multiblock erase verify read timeout 100us is the maximum
> > for none-error case. If errors happen during multibock erase then
> > the specification recommends to run multiblock erase verify command
> > with maximum timeout 10ms (see specs. for KFM4G16Q2A and KFN8G16Q2A).
> > 
> > For the most common non-error case we wait 100us in udelay polling
> > loop. In case of timeout the interrupt mode is used to wait for the
> > command end.
> > 
> > Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> 
> I'll queue this series. Anybody from MTD list care to ack this patch?

Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

^ permalink raw reply

* [PATCH 18/29] mfd-core: rename platform_data field of mfd_cell to mfd_data
From: Andres Salomon @ 2011-02-18  3:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1297998456-7615-1-git-send-email-dilinger@queued.net>

Rename the platform_data variable to imply a distinction between
common platform_data driver usage (typically accessed via
pdev->dev.platform_data) and the way MFD passes data down to
clients (using a wrapper named mfd_get_data).

All clients have already been changed to use the wrapper function,
so this can be a quick single-commit change that only touches things
in drivers/mfd.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
---
 drivers/mfd/ab3100-core.c   |    2 +-
 drivers/mfd/ab3550-core.c   |    2 +-
 drivers/mfd/janz-cmodio.c   |    2 +-
 drivers/mfd/mc13xxx-core.c  |    2 +-
 drivers/mfd/timberdale.c    |   54 +++++++++++++++++++++---------------------
 drivers/mfd/twl4030-codec.c |    4 +-
 drivers/mfd/wl1273-core.c   |    4 +-
 include/linux/mfd/core.h    |    8 +++---
 8 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index b44c3d9..865251e 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -950,7 +950,7 @@ static int __devinit ab3100_probe(struct i2c_client *client,
 
 	/* Set up and register the platform devices. */
 	for (i = 0; i < ARRAY_SIZE(ab3100_devs); i++)
-		ab3100_devs[i].platform_data = ab3100_plf_data;
+		ab3100_devs[i].mfd_data = ab3100_plf_data;
 
 	err = mfd_add_devices(&client->dev, 0, ab3100_devs,
 		ARRAY_SIZE(ab3100_devs), NULL, 0);
diff --git a/drivers/mfd/ab3550-core.c b/drivers/mfd/ab3550-core.c
index d849087..f4c12a4 100644
--- a/drivers/mfd/ab3550-core.c
+++ b/drivers/mfd/ab3550-core.c
@@ -1321,7 +1321,7 @@ static int __init ab3550_probe(struct i2c_client *client,
 
 	/* Set up and register the platform devices. */
 	for (i = 0; i < AB3550_NUM_DEVICES; i++)
-		ab3550_devs[i].platform_data = ab3550_plf_data->dev_data[i];
+		ab3550_devs[i].mfd_data = ab3550_plf_data->dev_data[i];
 
 	err = mfd_add_devices(&client->dev, 0, ab3550_devs,
 		ARRAY_SIZE(ab3550_devs), NULL,
diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
index 58de1e2..fc41911 100644
--- a/drivers/mfd/janz-cmodio.c
+++ b/drivers/mfd/janz-cmodio.c
@@ -86,7 +86,7 @@ static int __devinit cmodio_setup_subdevice(struct cmodio_device *priv,
 
 	/* Add platform data */
 	pdata->modno = modno;
-	cell->platform_data = pdata;
+	cell->mfd_data = pdata;
 
 	/* MODULbus registers -- PCI BAR3 is big-endian MODULbus access */
 	res->flags = IORESOURCE_MEM;
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 00c5490..b19b50a 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -689,7 +689,7 @@ static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
 	const char *name = mc13xxx_get_chipname(mc13xxx);
 
 	struct mfd_cell cell = {
-		.platform_data = pdata,
+		.mfd_data = pdata,
 	};
 
 	/* there is no asnprintf in the kernel :-( */
diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 6353921..94c6c8a 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -384,7 +384,7 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.platform_data = &timb_dma_platform_data,
+		.mfd_data = &timb_dma_platform_data,
 	},
 	{
 		.name = "timb-uart",
@@ -395,37 +395,37 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
 		.name = "xiic-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
 		.resources = timberdale_xiic_resources,
-		.platform_data = &timberdale_xiic_platform_data,
+		.mfd_data = &timberdale_xiic_platform_data,
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
+		.mfd_data = &timberdale_gpio_platform_data,
 	},
 	{
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.platform_data = &timberdale_video_platform_data,
+		.mfd_data = &timberdale_video_platform_data,
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.platform_data = &timberdale_radio_platform_data,
+		.mfd_data = &timberdale_radio_platform_data,
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.platform_data = &timberdale_xspi_platform_data,
+		.mfd_data = &timberdale_xspi_platform_data,
 	},
 	{
 		.name = "ks8842",
 		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
 		.resources = timberdale_eth_resources,
-		.platform_data = &timberdale_ks8842_platform_data,
+		.mfd_data = &timberdale_ks8842_platform_data,
 	},
 };
 
@@ -434,7 +434,7 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.platform_data = &timb_dma_platform_data,
+		.mfd_data = &timb_dma_platform_data,
 	},
 	{
 		.name = "timb-uart",
@@ -450,13 +450,13 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "xiic-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
 		.resources = timberdale_xiic_resources,
-		.platform_data = &timberdale_xiic_platform_data,
+		.mfd_data = &timberdale_xiic_platform_data,
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
+		.mfd_data = &timberdale_gpio_platform_data,
 	},
 	{
 		.name = "timb-mlogicore",
@@ -467,25 +467,25 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.platform_data = &timberdale_video_platform_data,
+		.mfd_data = &timberdale_video_platform_data,
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.platform_data = &timberdale_radio_platform_data,
+		.mfd_data = &timberdale_radio_platform_data,
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.platform_data = &timberdale_xspi_platform_data,
+		.mfd_data = &timberdale_xspi_platform_data,
 	},
 	{
 		.name = "ks8842",
 		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
 		.resources = timberdale_eth_resources,
-		.platform_data = &timberdale_ks8842_platform_data,
+		.mfd_data = &timberdale_ks8842_platform_data,
 	},
 };
 
@@ -494,7 +494,7 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.platform_data = &timb_dma_platform_data,
+		.mfd_data = &timb_dma_platform_data,
 	},
 	{
 		.name = "timb-uart",
@@ -505,31 +505,31 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
 		.name = "xiic-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_xiic_resources),
 		.resources = timberdale_xiic_resources,
-		.platform_data = &timberdale_xiic_platform_data,
+		.mfd_data = &timberdale_xiic_platform_data,
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
+		.mfd_data = &timberdale_gpio_platform_data,
 	},
 	{
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.platform_data = &timberdale_video_platform_data,
+		.mfd_data = &timberdale_video_platform_data,
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.platform_data = &timberdale_radio_platform_data,
+		.mfd_data = &timberdale_radio_platform_data,
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.platform_data = &timberdale_xspi_platform_data,
+		.mfd_data = &timberdale_xspi_platform_data,
 	},
 };
 
@@ -538,7 +538,7 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
 		.name = "timb-dma",
 		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
 		.resources = timberdale_dma_resources,
-		.platform_data = &timb_dma_platform_data,
+		.mfd_data = &timb_dma_platform_data,
 	},
 	{
 		.name = "timb-uart",
@@ -549,37 +549,37 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
 		.name = "ocores-i2c",
 		.num_resources = ARRAY_SIZE(timberdale_ocores_resources),
 		.resources = timberdale_ocores_resources,
-		.platform_data = &timberdale_ocores_platform_data,
+		.mfd_data = &timberdale_ocores_platform_data,
 	},
 	{
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
+		.mfd_data = &timberdale_gpio_platform_data,
 	},
 	{
 		.name = "timb-video",
 		.num_resources = ARRAY_SIZE(timberdale_video_resources),
 		.resources = timberdale_video_resources,
-		.platform_data = &timberdale_video_platform_data,
+		.mfd_data = &timberdale_video_platform_data,
 	},
 	{
 		.name = "timb-radio",
 		.num_resources = ARRAY_SIZE(timberdale_radio_resources),
 		.resources = timberdale_radio_resources,
-		.platform_data = &timberdale_radio_platform_data,
+		.mfd_data = &timberdale_radio_platform_data,
 	},
 	{
 		.name = "xilinx_spi",
 		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
 		.resources = timberdale_spi_resources,
-		.platform_data = &timberdale_xspi_platform_data,
+		.mfd_data = &timberdale_xspi_platform_data,
 	},
 	{
 		.name = "ks8842",
 		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
 		.resources = timberdale_eth_resources,
-		.platform_data = &timberdale_ks8842_platform_data,
+		.mfd_data = &timberdale_ks8842_platform_data,
 	},
 };
 
diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-codec.c
index 0f57426..c02fded 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-codec.c
@@ -208,13 +208,13 @@ static int __devinit twl4030_codec_probe(struct platform_device *pdev)
 	if (pdata->audio) {
 		cell = &codec->cells[childs];
 		cell->name = "twl4030-codec";
-		cell->platform_data = pdata->audio;
+		cell->mfd_data = pdata->audio;
 		childs++;
 	}
 	if (pdata->vibra) {
 		cell = &codec->cells[childs];
 		cell->name = "twl4030-vibra";
-		cell->platform_data = pdata->vibra;
+		cell->mfd_data = pdata->vibra;
 		childs++;
 	}
 
diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c
index 703085e..f49e04e 100644
--- a/drivers/mfd/wl1273-core.c
+++ b/drivers/mfd/wl1273-core.c
@@ -79,7 +79,7 @@ static int __devinit wl1273_core_probe(struct i2c_client *client,
 
 	cell = &core->cells[children];
 	cell->name = "wl1273_fm_radio";
-	cell->platform_data = &core;
+	cell->mfd_data = &core;
 	children++;
 
 	if (pdata->children & WL1273_CODEC_CHILD) {
@@ -87,7 +87,7 @@ static int __devinit wl1273_core_probe(struct i2c_client *client,
 
 		dev_dbg(&client->dev, "%s: Have codec.\n", __func__);
 		cell->name = "wl1273-codec";
-		cell->platform_data = &core;
+		cell->mfd_data = &core;
 		children++;
 	}
 
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 923ec25..f317fe4 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -33,8 +33,8 @@ struct mfd_cell {
 	/* driver-specific data for MFD-aware "cell" drivers */
 	void			*driver_data;
 
-	/* platform_data can be used to pass data to "generic" drivers */
-	void			*platform_data;
+	/* mfd_data can be used to pass data to client drivers */
+	void			*mfd_data;
 
 	/*
 	 * These resources can be specified relative to the parent device.
@@ -64,11 +64,11 @@ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev)
 
 /*
  * Given a platform device that's been created by mfd_add_devices(), fetch
- * the .platform_data entry from the mfd_cell that created it.
+ * the .mfd_data entry from the mfd_cell that created it.
  */
 static inline void *mfd_get_data(struct platform_device *pdev)
 {
-	return mfd_get_cell(pdev)->platform_data;
+	return mfd_get_cell(pdev)->mfd_data;
 }
 
 extern int mfd_add_devices(struct device *parent, int id,
-- 
1.7.2.3

^ permalink raw reply related

* [PATCH 16/29] mc13xxx: mfd_cell is now implicitly available to drivers (v2)
From: Andres Salomon @ 2011-02-18  3:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1297998456-7615-1-git-send-email-dilinger@queued.net>

The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.

Note that mfd-core no longer makes a copy of platform_data, but the
mc13xxx-core driver creates the pdata structures on the stack.  In
order to get around that, the various ARM mach types that set the
pdata have been changed to hold the variable in static (global) memory.
Also note that __initdata references in aforementioned pdata structs
have been dropped.

v2: add some missing mfd/core.h includes.
v2: embed regulators struct inside of mc13xxx_platform_data rather than
    using a pointer.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 arch/arm/mach-imx/mach-mx27_3ds.c     |    9 ++++++---
 arch/arm/mach-imx/mach-pcm038.c       |    6 ++++--
 arch/arm/mach-mx3/mach-mx31_3ds.c     |    8 +++++---
 arch/arm/mach-mx3/mach-mx31moboard.c  |    6 ++++--
 drivers/leds/leds-mc13783.c           |    7 ++++---
 drivers/mfd/mc13xxx-core.c            |   18 +++++-------------
 drivers/regulator/mc13783-regulator.c |    7 +++----
 drivers/regulator/mc13892-regulator.c |    7 +++----
 include/linux/mfd/mc13xxx.h           |    3 +--
 9 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 1643315..4bf1962 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -227,9 +227,12 @@ static struct mc13783_regulator_init_data mx27_3ds_regulators[] = {
 };
 
 /* MC13783 */
-static struct mc13783_platform_data mc13783_pdata __initdata = {
-	.regulators = mx27_3ds_regulators,
-	.num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
+static struct mc13783_platform_data mc13783_pdata = {
+	.regulators = {
+		.regulators = mx27_3ds_regulators,
+		.num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
+
+	},
 	.flags  = MC13783_USE_REGULATOR,
 };
 
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 5056148..c4c8fb1 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -263,8 +263,10 @@ static struct mc13783_regulator_init_data pcm038_regulators[] = {
 };
 
 static struct mc13783_platform_data pcm038_pmic = {
-	.regulators = pcm038_regulators,
-	.num_regulators = ARRAY_SIZE(pcm038_regulators),
+	.regulators = {
+		.regulators = pcm038_regulators,
+		.num_regulators = ARRAY_SIZE(pcm038_regulators),
+	},
 	.flags = MC13783_USE_ADC | MC13783_USE_REGULATOR |
 		 MC13783_USE_TOUCHSCREEN,
 };
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index 0d65db8..88516af 100644
--- a/arch/arm/mach-mx3/mach-mx31_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -156,9 +156,11 @@ static struct mc13783_regulator_init_data mx31_3ds_regulators[] = {
 };
 
 /* MC13783 */
-static struct mc13783_platform_data mc13783_pdata __initdata = {
-	.regulators = mx31_3ds_regulators,
-	.num_regulators = ARRAY_SIZE(mx31_3ds_regulators),
+static struct mc13783_platform_data mc13783_pdata = {
+	.regulators = {
+		.regulators = mx31_3ds_regulators,
+		.num_regulators = ARRAY_SIZE(mx31_3ds_regulators),
+	},
 	.flags  = MC13783_USE_REGULATOR | MC13783_USE_TOUCHSCREEN,
 };
 
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c
index 1aa8d65..3a9c589 100644
--- a/arch/arm/mach-mx3/mach-mx31moboard.c
+++ b/arch/arm/mach-mx3/mach-mx31moboard.c
@@ -268,8 +268,10 @@ static struct mc13783_leds_platform_data moboard_leds = {
 };
 
 static struct mc13783_platform_data moboard_pmic = {
-	.regulators = moboard_regulators,
-	.num_regulators = ARRAY_SIZE(moboard_regulators),
+	.regulators = {
+		.regulators = moboard_regulators,
+		.num_regulators = ARRAY_SIZE(moboard_regulators),
+	},
 	.leds = &moboard_leds,
 	.flags = MC13783_USE_REGULATOR | MC13783_USE_RTC |
 		MC13783_USE_ADC | MC13783_USE_LED,
diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
index f05bb08..06a5bb4 100644
--- a/drivers/leds/leds-mc13783.c
+++ b/drivers/leds/leds-mc13783.c
@@ -22,6 +22,7 @@
 #include <linux/leds.h>
 #include <linux/workqueue.h>
 #include <linux/mfd/mc13783.h>
+#include <linux/mfd/core.h>
 #include <linux/slab.h>
 
 struct mc13783_led {
@@ -183,7 +184,7 @@ static int __devinit mc13783_led_setup(struct mc13783_led *led, int max_current)
 
 static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
 {
-	struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
+	struct mc13783_leds_platform_data *pdata = mfd_get_data(pdev);
 	struct mc13783 *dev = dev_get_drvdata(pdev->dev.parent);
 	int ret = 0;
 	int reg = 0;
@@ -264,7 +265,7 @@ out:
 
 static int __devinit mc13783_led_probe(struct platform_device *pdev)
 {
-	struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
+	struct mc13783_leds_platform_data *pdata = mfd_get_data(pdev);
 	struct mc13783_led_platform_data *led_cur;
 	struct mc13783_led *led, *led_dat;
 	int ret, i;
@@ -351,7 +352,7 @@ err_free:
 
 static int __devexit mc13783_led_remove(struct platform_device *pdev)
 {
-	struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
+	struct mc13783_leds_platform_data *pdata = mfd_get_data(pdev);
 	struct mc13783_led *led = platform_get_drvdata(pdev);
 	struct mc13783 *dev = dev_get_drvdata(pdev->dev.parent);
 	int i;
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index b9fcaf0..30807d3 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -683,14 +683,13 @@ out:
 EXPORT_SYMBOL_GPL(mc13783_adc_do_conversion);
 
 static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
-		const char *format, void *pdata, size_t pdata_size)
+		const char *format, void *pdata)
 {
 	char buf[30];
 	const char *name = mc13xxx_get_chipname(mc13xxx);
 
 	struct mfd_cell cell = {
 		.platform_data = pdata,
-		.data_size = pdata_size,
 	};
 
 	/* there is no asnprintf in the kernel :-( */
@@ -706,7 +705,7 @@ static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
 
 static int mc13xxx_add_subdevice(struct mc13xxx *mc13xxx, const char *format)
 {
-	return mc13xxx_add_subdevice_pdata(mc13xxx, format, NULL, 0);
+	return mc13xxx_add_subdevice_pdata(mc13xxx, format, NULL);
 }
 
 static int mc13xxx_probe(struct spi_device *spi)
@@ -764,13 +763,8 @@ err_revision:
 		mc13xxx_add_subdevice(mc13xxx, "%s-codec");
 
 	if (pdata->flags & MC13XXX_USE_REGULATOR) {
-		struct mc13xxx_regulator_platform_data regulator_pdata = {
-			.num_regulators = pdata->num_regulators,
-			.regulators = pdata->regulators,
-		};
-
 		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",
-				&regulator_pdata, sizeof(regulator_pdata));
+				&pdata->regulators);
 	}
 
 	if (pdata->flags & MC13XXX_USE_RTC)
@@ -779,10 +773,8 @@ err_revision:
 	if (pdata->flags & MC13XXX_USE_TOUCHSCREEN)
 		mc13xxx_add_subdevice(mc13xxx, "%s-ts");
 
-	if (pdata->flags & MC13XXX_USE_LED) {
-		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led",
-					pdata->leds, sizeof(*pdata->leds));
-	}
+	if (pdata->flags & MC13XXX_USE_LED)
+		mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led", pdata->leds);
 
 	return 0;
 }
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c
index 3e5d0c3..23249cb 100644
--- a/drivers/regulator/mc13783-regulator.c
+++ b/drivers/regulator/mc13783-regulator.c
@@ -15,6 +15,7 @@
 #include <linux/regulator/driver.h>
 #include <linux/platform_device.h>
 #include <linux/kernel.h>
+#include <linux/mfd/core.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/err.h>
@@ -336,8 +337,7 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev)
 {
 	struct mc13xxx_regulator_priv *priv;
 	struct mc13xxx *mc13783 = dev_get_drvdata(pdev->dev.parent);
-	struct mc13783_regulator_platform_data *pdata =
-		dev_get_platdata(&pdev->dev);
+	struct mc13783_regulator_platform_data *pdata = mfd_get_data(pdev);
 	struct mc13783_regulator_init_data *init_data;
 	int i, ret;
 
@@ -381,8 +381,7 @@ err:
 static int __devexit mc13783_regulator_remove(struct platform_device *pdev)
 {
 	struct mc13xxx_regulator_priv *priv = platform_get_drvdata(pdev);
-	struct mc13783_regulator_platform_data *pdata =
-		dev_get_platdata(&pdev->dev);
+	struct mc13783_regulator_platform_data *pdata = mfd_get_data(pdev);
 	int i;
 
 	platform_set_drvdata(pdev, NULL);
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
index 1b8f739..6f15168 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
@@ -15,6 +15,7 @@
 #include <linux/regulator/driver.h>
 #include <linux/platform_device.h>
 #include <linux/kernel.h>
+#include <linux/mfd/core.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/err.h>
@@ -520,8 +521,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
 {
 	struct mc13xxx_regulator_priv *priv;
 	struct mc13xxx *mc13892 = dev_get_drvdata(pdev->dev.parent);
-	struct mc13xxx_regulator_platform_data *pdata =
-		dev_get_platdata(&pdev->dev);
+	struct mc13xxx_regulator_platform_data *pdata = mfd_get_data(pdev);
 	struct mc13xxx_regulator_init_data *init_data;
 	int i, ret;
 	u32 val;
@@ -595,8 +595,7 @@ err_free:
 static int __devexit mc13892_regulator_remove(struct platform_device *pdev)
 {
 	struct mc13xxx_regulator_priv *priv = platform_get_drvdata(pdev);
-	struct mc13xxx_regulator_platform_data *pdata =
-		dev_get_platdata(&pdev->dev);
+	struct mc13xxx_regulator_platform_data *pdata = mfd_get_data(pdev);
 	int i;
 
 	platform_set_drvdata(pdev, NULL);
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index a1d391b..c064bea 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -146,8 +146,7 @@ struct mc13xxx_platform_data {
 #define MC13XXX_USE_LED		(1 << 5)
 	unsigned int flags;
 
-	int num_regulators;
-	struct mc13xxx_regulator_init_data *regulators;
+	struct mc13xxx_regulator_platform_data regulators;
 	struct mc13xxx_leds_platform_data *leds;
 };
 
-- 
1.7.2.3

^ permalink raw reply related

* [PATCH 05/29] ab3100: mfd_cell is now implicitly available to drivers (v2)
From: Andres Salomon @ 2011-02-18  3:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1297998456-7615-1-git-send-email-dilinger@queued.net>

The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.

v2: add some missing mfd/core.h includes.

Signed-off-by: Andres Salomon <dilinger@queued.net>
---
 drivers/mfd/ab3100-core.c  |    4 +---
 drivers/regulator/ab3100.c |    3 ++-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index 4193af5..b44c3d9 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -949,10 +949,8 @@ static int __devinit ab3100_probe(struct i2c_client *client,
 		goto exit_no_ops;
 
 	/* Set up and register the platform devices. */
-	for (i = 0; i < ARRAY_SIZE(ab3100_devs); i++) {
+	for (i = 0; i < ARRAY_SIZE(ab3100_devs); i++)
 		ab3100_devs[i].platform_data = ab3100_plf_data;
-		ab3100_devs[i].data_size = sizeof(struct ab3100_platform_data);
-	}
 
 	err = mfd_add_devices(&client->dev, 0, ab3100_devs,
 		ARRAY_SIZE(ab3100_devs), NULL, 0);
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c
index ed6feaf..2dec589 100644
--- a/drivers/regulator/ab3100.c
+++ b/drivers/regulator/ab3100.c
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/mfd/abx500.h>
+#include <linux/mfd/core.h>
 
 /* LDO registers and some handy masking definitions for AB3100 */
 #define AB3100_LDO_A		0x40
@@ -576,7 +577,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
 
 static int __devinit ab3100_regulators_probe(struct platform_device *pdev)
 {
-	struct ab3100_platform_data *plfdata = pdev->dev.platform_data;
+	struct ab3100_platform_data *plfdata = mfd_get_data(pdev);
 	int err = 0;
 	u8 data;
 	int i;
-- 
1.7.2.3

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox