From: sleep_walker@suse.cz (Tomáš Čech)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] Treo680: pxamci simplify to use GPIO
Date: Thu, 27 Aug 2009 02:43:27 +0200 [thread overview]
Message-ID: <1251333811-22360-2-git-send-email-sleep_walker@suse.cz> (raw)
In-Reply-To: <1251333811-22360-1-git-send-email-sleep_walker@suse.cz>
From: Tom?? ?ech <sleep walker@suse.cz>
---
arch/arm/mach-pxa/treo680.c | 84 ++----------------------------------------
1 files changed, 4 insertions(+), 80 deletions(-)
diff --git a/arch/arm/mach-pxa/treo680.c b/arch/arm/mach-pxa/treo680.c
index a06f19e..050ad8e 100644
--- a/arch/arm/mach-pxa/treo680.c
+++ b/arch/arm/mach-pxa/treo680.c
@@ -153,87 +153,11 @@ static unsigned long treo680_pin_config[] __initdata = {
/******************************************************************************
* SD/MMC card controller
******************************************************************************/
-static int treo680_mci_init(struct device *dev,
- irq_handler_t treo680_detect_int, void *data)
-{
- int err = 0;
-
- /* Setup an interrupt for detecting card insert/remove events */
- err = gpio_request(GPIO_NR_TREO680_SD_DETECT_N, "SD IRQ");
-
- if (err)
- goto err;
-
- err = gpio_direction_input(GPIO_NR_TREO680_SD_DETECT_N);
- if (err)
- goto err2;
-
- err = request_irq(gpio_to_irq(GPIO_NR_TREO680_SD_DETECT_N),
- treo680_detect_int, IRQF_DISABLED | IRQF_SAMPLE_RANDOM |
- IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
- "SD/MMC card detect", data);
-
- if (err) {
- dev_err(dev, "%s: cannot request SD/MMC card detect IRQ\n",
- __func__);
- goto err2;
- }
-
- err = gpio_request(GPIO_NR_TREO680_SD_POWER, "SD_POWER");
- if (err)
- goto err3;
-
- err = gpio_direction_output(GPIO_NR_TREO680_SD_POWER, 1);
- if (err)
- goto err4;
-
- err = gpio_request(GPIO_NR_TREO680_SD_READONLY, "SD_READONLY");
- if (err)
- goto err4;
-
- err = gpio_direction_input(GPIO_NR_TREO680_SD_READONLY);
- if (err)
- goto err5;
-
- return 0;
-
-err5:
- gpio_free(GPIO_NR_TREO680_SD_READONLY);
-err4:
- gpio_free(GPIO_NR_TREO680_SD_POWER);
-err3:
- free_irq(gpio_to_irq(GPIO_NR_TREO680_SD_DETECT_N), data);
-err2:
- gpio_free(GPIO_NR_TREO680_SD_DETECT_N);
-err:
- return err;
-}
-
-static void treo680_mci_exit(struct device *dev, void *data)
-{
- gpio_free(GPIO_NR_TREO680_SD_READONLY);
- gpio_free(GPIO_NR_TREO680_SD_POWER);
- free_irq(gpio_to_irq(GPIO_NR_TREO680_SD_DETECT_N), data);
- gpio_free(GPIO_NR_TREO680_SD_DETECT_N);
-}
-
-static void treo680_mci_power(struct device *dev, unsigned int vdd)
-{
- struct pxamci_platform_data *p_d = dev->platform_data;
- gpio_set_value(GPIO_NR_TREO680_SD_POWER, p_d->ocr_mask & (1 << vdd));
-}
-
-static int treo680_mci_get_ro(struct device *dev)
-{
- return gpio_get_value(GPIO_NR_TREO680_SD_READONLY);
-}
-
static struct pxamci_platform_data treo680_mci_platform_data = {
- .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
- .setpower = treo680_mci_power,
- .get_ro = treo680_mci_get_ro,
- .init = treo680_mci_init,
- .exit = treo680_mci_exit,
+ .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
+ .gpio_card_detect = GPIO_NR_TREO680_SD_DETECT_N,
+ .gpio_card_ro = GPIO_NR_TREO680_SD_READONLY,
+ .gpio_power = GPIO_NR_TREO680_SD_POWER,
};
/******************************************************************************
--
1.6.3.3
next prev parent reply other threads:[~2009-08-27 0:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-27 0:43 update Treo680, generalise it and add Centro support Tomáš Čech
2009-08-27 0:43 ` Tomáš Čech [this message]
2009-08-27 0:43 ` [PATCH 2/5] Treo680: remove unused LCD power GPIO Tomáš Čech
2009-08-27 0:43 ` [PATCH 3/5] Treo680: fix freed GPIO in treo680_irda_shutdown() Tomáš Čech
2009-08-27 0:43 ` [PATCH 4/5] PalmGSM: generalisation of Treo680 code to PalmGSM Tomáš Čech
2009-08-27 0:43 ` [PATCH 5/5] PalmGSM: add basic Centro support Tomáš Čech
2009-08-27 13:35 ` Marek Vasut
2009-08-28 20:18 ` Tomáš 'Sleep_Walker' Čech
2009-08-27 2:31 ` [PATCH 4/5] PalmGSM: generalisation of Treo680 code to PalmGSM Eric Miao
2009-08-28 20:13 ` Tomáš 'Sleep_Walker' Čech
2009-08-31 10:43 ` Pavel Machek
2009-08-31 11:06 ` Tomáš 'Sleep_Walker' Čech
2009-09-01 0:07 ` Pavel Machek
2009-09-01 1:22 ` Marek Vasut
2009-09-01 9:39 ` Eric Miao
2009-09-01 20:50 ` Tomáš 'Sleep_Walker' Čech
2009-09-01 10:56 ` Tomáš 'Sleep_Walker' Čech
2009-08-31 10:44 ` [PATCH 1/5] Treo680: pxamci simplify to use GPIO Pavel Machek
2009-08-31 11:03 ` Tomáš 'Sleep_Walker' Čech
-- strict thread matches above, loose matches on Subject: below --
2009-08-31 17:25 update Treo680, generalise it and add Centro support - round 2 Tomáš Čech
2009-08-31 17:25 ` [PATCH 1/5] Treo680: pxamci simplify to use GPIO Tomáš Čech
2009-08-31 17:33 ` Marek Vasut
2009-09-01 9:36 ` Eric Miao
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=1251333811-22360-2-git-send-email-sleep_walker@suse.cz \
--to=sleep_walker@suse.cz \
--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).