From: "stanley.miao" <stanley.miao@windriver.com>
To: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org, hvaibhav@ti.com, srk@ti.com,
anuj.aggarwal@ti.com
Subject: Re: [PATCH 7/7] omap hsmmc: fix the hsmmc driver for am3517.
Date: Thu, 13 May 2010 19:53:13 +0800 [thread overview]
Message-ID: <4BEBE829.8020801@windriver.com> (raw)
In-Reply-To: <20100511232656.GO13931@atomide.com>
Tony Lindgren wrote:
> Hi,
>
> Some requests to make this more future proof.
>
> * Stanley.Miao <stanley.miao@windriver.com> [100419 23:20]:
>
>> AM3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
>> like "vmmc", so we set a noop "set_power" function for it.
>>
>> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
>> ---
>> arch/arm/mach-omap2/hsmmc.c | 32 ++++++++++++++++++++++++--------
>> 1 files changed, 24 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
>> index 9ad2295..5f46797 100644
>> --- a/arch/arm/mach-omap2/hsmmc.c
>> +++ b/arch/arm/mach-omap2/hsmmc.c
>> @@ -139,6 +139,12 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot,
>> }
>> }
>>
>> +static int am3517_mmc_set_power(struct device *dev, int slot, int power_on,
>> + int vdd)
>> +{
>> + return 0;
>> +}
>> +
>>
>
> Please rename this to nop_mmc_set_power or similar. Other omaps may
> need it too.
>
Accepted.
>
>> static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
>>
>> void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>> @@ -150,7 +156,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>> if (cpu_is_omap2430()) {
>> control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
>> control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
>> - } else {
>> + } else if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
>> control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
>> control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
>> }
>>
>
> Let's get rid of multiple cpu_is_omapxxxx tests please. Could you please
> update this along the lines of something like this:
>
> #define HSMMC_HAS_PBIAS (1 << 0)
> #define HSMMC_HAS_WHATEVER (1 << 1)
> ...
>
> if (!(cpu_is_omap3517() || cpu_is_omap3505())
> mmc->slots[i].features |= HSMMC_HAS_PBIAS;
>
Accepted.
We can move other features into the variable "features", such as
"nonremovable", "power_saving".
Stanley.
>
>> @@ -216,12 +222,25 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>> */
>> mmc->slots[0].ocr_mask = c->ocr_mask;
>>
>> + if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
>> + switch (c->mmc) {
>> + case 1:
>> + /* on-chip level shifting via PBIAS0/PBIAS1 */
>> + mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
>> + mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
>> + break;
>> + case 2:
>> + case 3:
>> + /* off-chip level shifting, or none */
>> + mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
>> + mmc->slots[0].after_set_reg = NULL;
>> + break;
>> + }
>> + } else /* cpu_is_omap3517() || cpu_is_omap3505() */
>> + mmc->slots[0].set_power = am3517_mmc_set_power;
>> +
>>
>
> Then you can test for that flag here too. When new omaps get added, it
> just a question of setting the features flags right.
>
> Regards,
>
> Tony
>
>
next prev parent reply other threads:[~2010-05-13 11:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-20 6:33 [PATCH 0/7] Some am3517 related patches [V3] Stanley.Miao
2010-04-20 6:33 ` [PATCH 1/7] omap: fix the compile error if CONFIG_MTD_NAND_OMAP2 is not enabled Stanley.Miao
2010-04-22 22:59 ` [APPLIED] [PATCH 1/7] omap: fix the compile error if CONFIG_MTD_NAND_OMAP2 is Tony Lindgren
2010-04-20 6:33 ` [PATCH 2/7] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL Stanley.Miao
2010-04-22 22:59 ` [APPLIED] [PATCH 2/7] omap: remove one of the define of Tony Lindgren
2010-04-20 6:33 ` [PATCH 3/7] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
2010-04-20 6:30 ` Felipe Balbi
2010-04-20 7:10 ` Hiremath, Vaibhav
2010-04-20 7:14 ` stanley.miao
2010-04-20 7:07 ` Hiremath, Vaibhav
2010-05-11 23:19 ` Tony Lindgren
2010-05-13 6:05 ` stanley.miao
2010-04-20 6:33 ` [PATCH 4/7] AM3517: initialize i2c subsystem after mux subsystem Stanley.Miao
2010-04-22 23:01 ` [APPLIED] " Tony Lindgren
2010-04-20 6:33 ` [PATCH 5/7] OMAP: fix a gpmc nand problem Stanley.Miao
2010-04-22 23:01 ` [APPLIED] " Tony Lindgren
2010-04-20 6:33 ` [PATCH 6/7] omap: init the gpio pinmux for mmc Stanley.Miao
2010-05-11 23:13 ` Tony Lindgren
2010-05-13 6:02 ` stanley.miao
2010-04-20 6:33 ` [PATCH 7/7] omap hsmmc: fix the hsmmc driver for am3517 Stanley.Miao
2010-05-11 23:26 ` Tony Lindgren
2010-05-13 11:53 ` stanley.miao [this message]
2010-05-13 15:58 ` Tony Lindgren
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=4BEBE829.8020801@windriver.com \
--to=stanley.miao@windriver.com \
--cc=anuj.aggarwal@ti.com \
--cc=hvaibhav@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=srk@ti.com \
--cc=tony@atomide.com \
/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.