All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] sunxi: Add mmc card-detect functionality
Date: Sun, 05 Oct 2014 16:58:59 +0200	[thread overview]
Message-ID: <54315CB3.4030106@redhat.com> (raw)
In-Reply-To: <1412411440.17796.56.camel@hellion.org.uk>

Hi,

On 10/04/2014 10:30 AM, Ian Campbell wrote:
> On Fri, 2014-10-03 at 17:05 +0200, Hans de Goede wrote:
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  board/sunxi/Kconfig     | 27 +++++++++++++++++++++++++++
>>  drivers/mmc/sunxi_mmc.c | 20 ++++++++++++++++++++
>>  2 files changed, 47 insertions(+)
>>
>> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
>> index 622f7b4..72d6dfa 100644
>> --- a/board/sunxi/Kconfig
>> +++ b/board/sunxi/Kconfig
>> @@ -32,4 +32,31 @@ config USB_KEYBOARD
>>  	Say Y here to add support for using a USB keyboard (typically used
>>  	in combination with a graphical console on HDMI).
>>  
>> +config MMC0_CD_PIN
>> +	int "Card detect pin for mmc0"
>> +	default -1
>> +	---help---
>> +	Set the card detect pin for mmc0, set to -1 to not use cd. The pins
>> +	are numbered as follows PA0 - PA17 are pin number 0 - 17, PB0 - PB23
>> +	are 32 - 55, PC0 - PC24 are 64 - 88, etc. Most boards use PH1 for
>> +	mmc0 cd, which is pin nr 225.
> 
> Is there any way we could use the same trick as for SATAPWR and allow
> this to be specified as something like GPx(y) instead of requiring this
> complex mapping in the help text? Might be possible with some
> combination of Kconfig and cpp trickery?
> 
> Maybe the simplest solution is to make this a string and pass it to
> name_to_gpio at runtime (e.g gpio = name_to_gpio(CONFIG_MMC0_CD_PIN)),
> although that has the disadvantage of being runtime only check.

I agree that being able to use symbolic names is much better, but I
could not find a Kconfig / cpp trickery way to do this. I think that
using name_to_gpio is a good solution for this, so that is what I'll
do for v2.

Regards,

Hans

  reply	other threads:[~2014-10-05 14:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 15:05 [U-Boot] [PATCH 0/6] sunxi: Add second sdcard slot support, including eMMC boot Hans de Goede
2014-10-03 15:05 ` [U-Boot] [PATCH 1/6] sunxi: Add sunxi_gpio_get_val function Hans de Goede
2014-10-04  8:14   ` Ian Campbell
2014-10-05 14:42     ` Hans de Goede
2014-10-03 15:05 ` [U-Boot] [PATCH 2/6] sunxi: Add mmc card-detect functionality Hans de Goede
2014-10-04  8:30   ` Ian Campbell
2014-10-05 14:58     ` Hans de Goede [this message]
2014-10-03 15:05 ` [U-Boot] [PATCH 3/6] sunxi: Turn MMC_SUNXI_SLOT_EXTRA into a proper Kconfig option Hans de Goede
2014-10-04  8:32   ` Ian Campbell
2014-10-05 15:00     ` Hans de Goede
2014-10-06  8:30       ` Ian Campbell
2014-10-03 15:05 ` [U-Boot] [PATCH 4/6] sunxi: When we've both mmc0 and mmc2, detect from which one we're booting Hans de Goede
2014-10-04  8:35   ` Ian Campbell
2014-10-05 15:10     ` Hans de Goede
2014-10-06  8:33       ` Ian Campbell
2014-10-06 14:23         ` Hans de Goede
2014-10-03 15:05 ` [U-Boot] [PATCH 5/6] sunxi: Use PG3 - PG8 as io-pins for mmc1 Hans de Goede
2014-10-04  8:37   ` Ian Campbell
2014-10-06  8:37     ` Hans de Goede
2014-10-06  8:42       ` Ian Campbell
2014-10-06 14:43     ` Hans de Goede
2014-10-06 15:42       ` Ian Campbell
2014-10-03 15:05 ` [U-Boot] [PATCH 6/6] sunxi: Enable second sdcard slot found on some boards Hans de Goede
2014-10-04  8:38   ` Ian Campbell
2014-10-04  8:39     ` Ian Campbell
2014-10-06  8:37       ` Hans de Goede

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=54315CB3.4030106@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.