From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/2] pxa/hx4700: Add PCMCIA/CF support
Date: Fri, 3 Feb 2012 09:05:59 +0000 [thread overview]
Message-ID: <20120203090559.GH889@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1328229586.3847.YahooMailClassic@web29018.mail.ird.yahoo.com>
On Fri, Feb 03, 2012 at 12:39:46AM +0000, Paul Parsons wrote:
> +static int hw_init(struct soc_pcmcia_socket *skt)
> +{
> + int ret;
> +
> + ret = gpio_request_array(gpios, ARRAY_SIZE(gpios));
> + if (ret)
> + goto out;
> +
> + irq_set_irq_type(gpio_to_irq(GPIOD4_CF_nCD), IRQ_TYPE_EDGE_BOTH);
You shouldn't need to set the IRQ type for this.
> +
> + skt->stat[SOC_STAT_CD].gpio = GPIOD4_CF_nCD;
> + skt->stat[SOC_STAT_CD].name = "PCMCIA CD";
> + skt->stat[SOC_STAT_RDY].gpio = GPIO60_HX4700_CF_RNB;
> + skt->stat[SOC_STAT_RDY].name = "PCMCIA Ready";
> +
> +out:
> + return ret;
> +}
...
> +static void socket_state(struct soc_pcmcia_socket *skt,
> + struct pcmcia_state *state)
> +{
> + state->detect = (gpio_get_value(GPIOD4_CF_nCD) == 0);
> + state->ready = (gpio_get_value(GPIO60_HX4700_CF_RNB) != 0);
soc_common reads these for you before calling your socket_state
function.
> + state->bvd1 = 1;
> + state->bvd2 = 1;
If you don't have the BVD signals, soc_common now defaults these to '1'.
> + state->wrprot = 0;
You don't need to set this - soc_common sets this to zero.
> + state->vs_3v = 1;
> + state->vs_Xv = 0;
But you will need these two.
> +}
...
> +static int __init hx4700_pcmcia_init(void)
> +{
> + struct platform_device *pdev;
> + int ret;
> +
> + if (!machine_is_h4700())
> + return -ENODEV;
> +
> + pdev = platform_device_alloc("pxa2xx-pcmcia", -1);
> + if (!pdev)
> + return -ENOMEM;
> +
> + ret = platform_device_add_data(pdev,
> + &hx4700_pcmcia_ops, sizeof(hx4700_pcmcia_ops));
> + if (ret)
> + goto out;
> +
> + ret = platform_device_add(pdev);
> + if (ret)
> + goto out;
pdev = platform_device_register_data(NULL, "pxa2xx-pcmcia", -1,
&hx4700_pcmcia_ops, sizeof(hx4700_pcmcia_ops));
if (IS_ERR(pdev))
return PTR_ERR(pdev);
> +
> + hx4700_pcmcia_device = pdev;
> + return 0;
> +
> +out:
> + platform_device_put(pdev);
> + return ret;
> +}
next prev parent reply other threads:[~2012-02-03 9:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-03 0:39 [PATCH v4 1/2] pxa/hx4700: Add PCMCIA/CF support Paul Parsons
2012-02-03 9:05 ` Russell King - ARM Linux [this message]
2012-02-03 19:35 ` Paul Parsons
2012-02-03 19:40 ` Russell King - ARM Linux
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=20120203090559.GH889@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).