public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: prylowski@metasoft•pl (Rafal Prylowski)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 2/3] ep93xx: IDE driver platform support code
Date: Fri, 30 Mar 2012 10:29:48 +0200	[thread overview]
Message-ID: <4F756EFC.3080501@metasoft.pl> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F00206970255B6@AUSP01VMBX24.collaborationhost.net>

On 2012-03-29 18:26, H Hartley Sweeten wrote:
>> +/*************************************************************************
>> + * EP93xx IDE
>> + *************************************************************************/
>> +static struct resource ep93xx_ide_resources[] = {
>> +	[0] = {
>> +		.start	= EP93XX_IDE_PHYS_BASE,
>> +		.end	= EP93XX_IDE_PHYS_BASE + 0xffff,
>> +		.flags	= IORESOURCE_MEM,
>> +	},
>> +	[1] = {
>> +		.start	= IRQ_EP93XX_EXT3,
>> +		.end	= IRQ_EP93XX_EXT3,
>> +		.flags	= IORESOURCE_IRQ,
>> +	},
>> +};
> 
> Please use the DEFINE_RES_* macros.
> Also, the last register in the IDE interface is at offset 0x34, so something like this:
> 
> static struct resource ep93xx_ide_resources[] = {
> 	DEFINE_RES_MEM(EP93XX_IDE_PHYS_BASE, 0x38),
> 	DEFINE_RES_IRQ(IRQ_EP93XX_EXT3),
> };
> 

Ok. Will do.

>> +void __init ep93xx_register_ide(void)
>> +{
>> +	/* GPIO ports E, G and H used by IDE */
>> +	ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_EONIDE |
>> +				 EP93XX_SYSCON_DEVCFG_GONIDE |
>> +				 EP93XX_SYSCON_DEVCFG_HONIDE);
>> +	platform_device_register(&ep93xx_ide_device);
>> +}
> 
> Please create ep93xx_ide_acquire_gpio and ep93xx_ide_acquire_gpio functions
> to set/clear the necessary SYSCON bits during the probe/remove of the ide driver.
> 
> This should also address your concern mentioned in PATCH 0/3 about making sure
> the pin muxing is correct when the driver is loaded.
> 
> The *_acquire_gpio function should also gpio_request  the pins before setting the
> SYSCON bits. That way if any of the pins are unavailable the driver will not load. Make
> sure to gpio_free the pins in the *_release_gpio function.  Look at how the keypad
> is handled for an example.

Yes, that makes sense. I will add necessary functions and modify the driver accordingly.

Thanks for comments.

Regards,
RP

  reply	other threads:[~2012-03-30  8:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  8:10 [PATCH 0/3] Add PATA host controller support for Cirrus Logic EP93xx CPU Rafal Prylowski
2012-03-29  8:17 ` [PATCH 1/3] PATA host controller driver for ep93xx Rafal Prylowski
2012-03-29 17:25   ` H Hartley Sweeten
2012-03-30  8:13     ` Rafal Prylowski
2012-03-29 22:21   ` Ryan Mallon
2012-03-30 10:13     ` Rafal Prylowski
2012-03-29 22:24   ` Ryan Mallon
2012-03-30  8:19     ` Rafal Prylowski
2012-03-30 20:18   ` Arnd Bergmann
2012-04-02  7:52     ` Rafal Prylowski
2012-04-02  8:08       ` Arnd Bergmann
2012-04-02  9:28         ` Rafal Prylowski
2012-04-02 10:24           ` Arnd Bergmann
2012-04-03  1:50       ` Ryan Mallon
2012-04-03  7:41         ` Arnd Bergmann
2012-03-29  8:19 ` [PATCH 2/3] ep93xx: IDE driver platform support code Rafal Prylowski
2012-03-29 16:26   ` H Hartley Sweeten
2012-03-30  8:29     ` Rafal Prylowski [this message]
2012-03-29  8:20 ` [PATCH 3/3] ep93xx: Add IDE support to edb93xx boards Rafal Prylowski
2012-03-29 16:32   ` H Hartley Sweeten
2012-03-30  8:32     ` Rafal Prylowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F756EFC.3080501@metasoft.pl \
    --to=prylowski@metasoft$(echo .)pl \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox