[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b8e1428-c1b6-86e4-8d21-4257bcc16a90@st.com>
Date: Mon, 27 Jan 2020 14:21:17 +0100
From: Ludovic BARRE <ludovic.barre@...com>
To: Ulf Hansson <ulf.hansson@...aro.org>
CC: Rob Herring <robh+dt@...nel.org>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
DTML <devicetree@...r.kernel.org>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>
Subject: Re: [PATCH 7/9] mmc: mmci: add volt_switch callbacks
hi Ulf
Le 1/24/20 à 2:12 PM, Ulf Hansson a écrit :
> On Fri, 10 Jan 2020 at 14:49, Ludovic Barre <ludovic.barre@...com> wrote:
>>
>> This patch adds 2 voltage switch callbacks in mmci_host_ops:
>> -prep_volt_switch allows to prepare voltage switch before to
>> sent the SD_SWITCH_VOLTAGE command (cmd11).
>> -volt_switch callback allows to define specific action after
>> regulator set voltage.
>
> I am fine with adding these callbacks, however I strongly suggest to
> have a reference to "signal voltage" in the name of the callbacks. As
> to avoid confusion for what there are used for.
>
> Perhaps ->post_sig_volt_switch() and ->pre_sig_volt_switch() can work?
>
sure, I change to post_sig_volt_switch and pre_sig_volt_switch.
>>
>> Signed-off-by: Ludovic Barre <ludovic.barre@...com>
>> ---
>> drivers/mmc/host/mmci.c | 8 ++++++++
>> drivers/mmc/host/mmci.h | 2 ++
>> 2 files changed, 10 insertions(+)
>>
>> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
>> index 00b473f57047..d76a59c06cb0 100644
>> --- a/drivers/mmc/host/mmci.c
>> +++ b/drivers/mmc/host/mmci.c
>> @@ -22,6 +22,7 @@
>> #include <linux/mmc/pm.h>
>> #include <linux/mmc/host.h>
>> #include <linux/mmc/card.h>
>> +#include <linux/mmc/sd.h>
>> #include <linux/mmc/slot-gpio.h>
>> #include <linux/amba/bus.h>
>> #include <linux/clk.h>
>> @@ -1207,6 +1208,9 @@ mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c)
>> writel_relaxed(clks, host->base + MMCIDATATIMER);
>> }
>>
>> + if (host->ops->prep_volt_switch && cmd->opcode == SD_SWITCH_VOLTAGE)
>> + host->ops->prep_volt_switch(host);
>> +
>> if (/*interrupt*/0)
>> c |= MCI_CPSM_INTERRUPT;
>>
>> @@ -1820,6 +1824,7 @@ static int mmci_get_cd(struct mmc_host *mmc)
>>
>> static int mmci_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios)
>> {
>> + struct mmci_host *host = mmc_priv(mmc);
>> int ret = 0;
>>
>> if (!IS_ERR(mmc->supply.vqmmc)) {
>> @@ -1839,6 +1844,9 @@ static int mmci_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios)
>> break;
>> }
>>
>> + if (!ret && host->ops && host->ops->volt_switch)
>> + ret = host->ops->volt_switch(host, ios);
>> +
>> if (ret)
>> dev_warn(mmc_dev(mmc), "Voltage switch failed\n");
>> }
>> diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
>> index ddcdfb827996..c04a144259a2 100644
>> --- a/drivers/mmc/host/mmci.h
>> +++ b/drivers/mmc/host/mmci.h
>> @@ -377,6 +377,8 @@ struct mmci_host_ops {
>> void (*set_clkreg)(struct mmci_host *host, unsigned int desired);
>> void (*set_pwrreg)(struct mmci_host *host, unsigned int pwr);
>> bool (*busy_complete)(struct mmci_host *host, u32 status, u32 err_msk);
>> + void (*prep_volt_switch)(struct mmci_host *host);
>> + int (*volt_switch)(struct mmci_host *host, struct mmc_ios *ios);
>> };
>>
>> struct mmci_host {
>> --
>> 2.17.1
>>
>
> Kind regards
> Uffe
>
Powered by blists - more mailing lists