* [PATCH 0/4] mmc/sdhci: sdhci_set_bus_width() cleanup
@ 2017-08-09 20:36 Michał Mirosław
2017-08-09 20:36 ` [PATCH 1/4] sdhci: key 8BITBUS bit off MMC_CAP_8_BIT_DATA Michał Mirosław
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Michał Mirosław @ 2017-08-09 20:36 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson, Thierry Reding, Jonathan Hunter,
Ben Dooks, Jaehoon Chung
Cc: linux-mmc, linux-tegra
Some SDHCI drivers are reimplementing sdhci_set_bus_width() just because
they support 8-bit bus but don't advertise full SDHCI 3.0 compliance.
This unnecessarily duplicates the function. Let's remove those duplicates.
Michał Mirosław (4):
sdhci: key 8BITBUS bit off MMC_CAP_8_BIT_DATA
mmc/sdhci-tegra: use generic sdhci_set_bus_width()
mmc/sdhci-pci: use generic sdhci_set_bus_width()
mmc/sdhci-s3c: use generic sdhci_set_bus_width()
drivers/mmc/host/sdhci-pci-core.c | 30 +++---------------------------
drivers/mmc/host/sdhci-s3c.c | 34 +---------------------------------
drivers/mmc/host/sdhci-tegra.c | 23 ++---------------------
drivers/mmc/host/sdhci.c | 5 ++---
4 files changed, 8 insertions(+), 84 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/4] sdhci: key 8BITBUS bit off MMC_CAP_8_BIT_DATA
2017-08-09 20:36 [PATCH 0/4] mmc/sdhci: sdhci_set_bus_width() cleanup Michał Mirosław
@ 2017-08-09 20:36 ` Michał Mirosław
[not found] ` <96ece1eb7b8f6e188e3975f75754aeaf195f3dc0.1502310654.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2017-08-09 20:36 ` [PATCH 2/4] mmc/sdhci-tegra: use generic sdhci_set_bus_width() Michał Mirosław
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Michał Mirosław @ 2017-08-09 20:36 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson, Thierry Reding, Jonathan Hunter,
Ben Dooks, Jaehoon Chung
Cc: linux-mmc, linux-tegra
Hosts supporting 8-bit bus are marked accordingly. If MMC_CAP_8_BIT_DATA
is not among host capabilities, 8BITBUS bit will never be set and it
is not cleared in case some non-SDHCI3 host uses it for something else.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/mmc/host/sdhci.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ecd0d4350e8a..cca21246cf61 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1544,10 +1544,9 @@ void sdhci_set_bus_width(struct sdhci_host *host, int width)
ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
if (width == MMC_BUS_WIDTH_8) {
ctrl &= ~SDHCI_CTRL_4BITBUS;
- if (host->version >= SDHCI_SPEC_300)
- ctrl |= SDHCI_CTRL_8BITBUS;
+ ctrl |= SDHCI_CTRL_8BITBUS;
} else {
- if (host->version >= SDHCI_SPEC_300)
+ if (host->mmc->caps & MMC_CAP_8_BIT_DATA)
ctrl &= ~SDHCI_CTRL_8BITBUS;
if (width == MMC_BUS_WIDTH_4)
ctrl |= SDHCI_CTRL_4BITBUS;
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/4] mmc/sdhci-tegra: use generic sdhci_set_bus_width()
2017-08-09 20:36 [PATCH 0/4] mmc/sdhci: sdhci_set_bus_width() cleanup Michał Mirosław
2017-08-09 20:36 ` [PATCH 1/4] sdhci: key 8BITBUS bit off MMC_CAP_8_BIT_DATA Michał Mirosław
@ 2017-08-09 20:36 ` Michał Mirosław
2017-08-14 12:03 ` Adrian Hunter
2017-08-09 20:36 ` [PATCH 3/4] mmc/sdhci-pci: " Michał Mirosław
2017-08-09 20:36 ` [PATCH 4/4] mmc/sdhci-s3c: " Michał Mirosław
3 siblings, 1 reply; 9+ messages in thread
From: Michał Mirosław @ 2017-08-09 20:36 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson, Thierry Reding, Jonathan Hunter,
Ben Dooks, Jaehoon Chung
Cc: linux-mmc, linux-tegra
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/mmc/host/sdhci-tegra.c | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 7f93079c7a3a..9a589b6a53dd 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -190,25 +190,6 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
tegra_host->ddr_signaling = false;
}
-static void tegra_sdhci_set_bus_width(struct sdhci_host *host, int bus_width)
-{
- u32 ctrl;
-
- ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
- if ((host->mmc->caps & MMC_CAP_8_BIT_DATA) &&
- (bus_width == MMC_BUS_WIDTH_8)) {
- ctrl &= ~SDHCI_CTRL_4BITBUS;
- ctrl |= SDHCI_CTRL_8BITBUS;
- } else {
- ctrl &= ~SDHCI_CTRL_8BITBUS;
- if (bus_width == MMC_BUS_WIDTH_4)
- ctrl |= SDHCI_CTRL_4BITBUS;
- else
- ctrl &= ~SDHCI_CTRL_4BITBUS;
- }
- sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
-}
-
static void tegra_sdhci_pad_autocalib(struct sdhci_host *host)
{
u32 val;
@@ -323,7 +304,7 @@ static const struct sdhci_ops tegra_sdhci_ops = {
.read_w = tegra_sdhci_readw,
.write_l = tegra_sdhci_writel,
.set_clock = tegra_sdhci_set_clock,
- .set_bus_width = tegra_sdhci_set_bus_width,
+ .set_bus_width = sdhci_set_bus_width,
.reset = tegra_sdhci_reset,
.platform_execute_tuning = tegra_sdhci_execute_tuning,
.set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
@@ -371,7 +352,7 @@ static const struct sdhci_ops tegra114_sdhci_ops = {
.write_w = tegra_sdhci_writew,
.write_l = tegra_sdhci_writel,
.set_clock = tegra_sdhci_set_clock,
- .set_bus_width = tegra_sdhci_set_bus_width,
+ .set_bus_width = sdhci_set_bus_width,
.reset = tegra_sdhci_reset,
.platform_execute_tuning = tegra_sdhci_execute_tuning,
.set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] mmc/sdhci-pci: use generic sdhci_set_bus_width()
2017-08-09 20:36 [PATCH 0/4] mmc/sdhci: sdhci_set_bus_width() cleanup Michał Mirosław
2017-08-09 20:36 ` [PATCH 1/4] sdhci: key 8BITBUS bit off MMC_CAP_8_BIT_DATA Michał Mirosław
2017-08-09 20:36 ` [PATCH 2/4] mmc/sdhci-tegra: use generic sdhci_set_bus_width() Michał Mirosław
@ 2017-08-09 20:36 ` Michał Mirosław
[not found] ` <b1a072bfd9f9d7934bef982e4a94734eccf0b8e4.1502310654.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2017-08-09 20:36 ` [PATCH 4/4] mmc/sdhci-s3c: " Michał Mirosław
3 siblings, 1 reply; 9+ messages in thread
From: Michał Mirosław @ 2017-08-09 20:36 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson, Thierry Reding, Jonathan Hunter,
Ben Dooks, Jaehoon Chung
Cc: linux-mmc, linux-tegra
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/mmc/host/sdhci-pci-core.c | 30 +++---------------------------
1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index 92fc3f7c538d..dfe217e7fbfe 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -35,7 +35,6 @@
#include "sdhci-pci-o2micro.h"
static int sdhci_pci_enable_dma(struct sdhci_host *host);
-static void sdhci_pci_set_bus_width(struct sdhci_host *host, int width);
static void sdhci_pci_hw_reset(struct sdhci_host *host);
#ifdef CONFIG_PM_SLEEP
@@ -547,7 +546,7 @@ static const struct sdhci_ops sdhci_intel_byt_ops = {
.set_clock = sdhci_set_clock,
.set_power = sdhci_intel_set_power,
.enable_dma = sdhci_pci_enable_dma,
- .set_bus_width = sdhci_pci_set_bus_width,
+ .set_bus_width = sdhci_set_bus_width,
.reset = sdhci_reset,
.set_uhs_signaling = sdhci_set_uhs_signaling,
.hw_reset = sdhci_pci_hw_reset,
@@ -1159,7 +1158,7 @@ static int amd_probe(struct sdhci_pci_chip *chip)
static const struct sdhci_ops amd_sdhci_pci_ops = {
.set_clock = sdhci_set_clock,
.enable_dma = sdhci_pci_enable_dma,
- .set_bus_width = sdhci_pci_set_bus_width,
+ .set_bus_width = sdhci_set_bus_width,
.reset = sdhci_reset,
.set_uhs_signaling = sdhci_set_uhs_signaling,
.platform_execute_tuning = amd_execute_tuning,
@@ -1750,29 +1749,6 @@ static int sdhci_pci_enable_dma(struct sdhci_host *host)
return 0;
}
-static void sdhci_pci_set_bus_width(struct sdhci_host *host, int width)
-{
- u8 ctrl;
-
- ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
-
- switch (width) {
- case MMC_BUS_WIDTH_8:
- ctrl |= SDHCI_CTRL_8BITBUS;
- ctrl &= ~SDHCI_CTRL_4BITBUS;
- break;
- case MMC_BUS_WIDTH_4:
- ctrl |= SDHCI_CTRL_4BITBUS;
- ctrl &= ~SDHCI_CTRL_8BITBUS;
- break;
- default:
- ctrl &= ~(SDHCI_CTRL_8BITBUS | SDHCI_CTRL_4BITBUS);
- break;
- }
-
- sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
-}
-
static void sdhci_pci_gpio_hw_reset(struct sdhci_host *host)
{
struct sdhci_pci_slot *slot = sdhci_priv(host);
@@ -1799,7 +1775,7 @@ static void sdhci_pci_hw_reset(struct sdhci_host *host)
static const struct sdhci_ops sdhci_pci_ops = {
.set_clock = sdhci_set_clock,
.enable_dma = sdhci_pci_enable_dma,
- .set_bus_width = sdhci_pci_set_bus_width,
+ .set_bus_width = sdhci_set_bus_width,
.reset = sdhci_reset,
.set_uhs_signaling = sdhci_set_uhs_signaling,
.hw_reset = sdhci_pci_hw_reset,
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/4] mmc/sdhci-s3c: use generic sdhci_set_bus_width()
2017-08-09 20:36 [PATCH 0/4] mmc/sdhci: sdhci_set_bus_width() cleanup Michał Mirosław
` (2 preceding siblings ...)
2017-08-09 20:36 ` [PATCH 3/4] mmc/sdhci-pci: " Michał Mirosław
@ 2017-08-09 20:36 ` Michał Mirosław
[not found] ` <4323de12fe8bf8c33211a39a5fb14563fb80f2e9.1502310654.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
3 siblings, 1 reply; 9+ messages in thread
From: Michał Mirosław @ 2017-08-09 20:36 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson, Thierry Reding, Jonathan Hunter,
Ben Dooks, Jaehoon Chung
Cc: linux-mmc, linux-tegra
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/mmc/host/sdhci-s3c.c | 34 +---------------------------------
1 file changed, 1 insertion(+), 33 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 7c065a70f92b..d328fcf284d1 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -414,43 +414,11 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
}
-/**
- * sdhci_s3c_set_bus_width - support 8bit buswidth
- * @host: The SDHCI host being queried
- * @width: MMC_BUS_WIDTH_ macro for the bus width being requested
- *
- * We have 8-bit width support but is not a v3 controller.
- * So we add platform_bus_width() and support 8bit width.
- */
-static void sdhci_s3c_set_bus_width(struct sdhci_host *host, int width)
-{
- u8 ctrl;
-
- ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
-
- switch (width) {
- case MMC_BUS_WIDTH_8:
- ctrl |= SDHCI_CTRL_8BITBUS;
- ctrl &= ~SDHCI_CTRL_4BITBUS;
- break;
- case MMC_BUS_WIDTH_4:
- ctrl |= SDHCI_CTRL_4BITBUS;
- ctrl &= ~SDHCI_CTRL_8BITBUS;
- break;
- default:
- ctrl &= ~SDHCI_CTRL_4BITBUS;
- ctrl &= ~SDHCI_CTRL_8BITBUS;
- break;
- }
-
- sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
-}
-
static struct sdhci_ops sdhci_s3c_ops = {
.get_max_clock = sdhci_s3c_get_max_clk,
.set_clock = sdhci_s3c_set_clock,
.get_min_clock = sdhci_s3c_get_min_clock,
- .set_bus_width = sdhci_s3c_set_bus_width,
+ .set_bus_width = sdhci_set_bus_width,
.reset = sdhci_reset,
.set_uhs_signaling = sdhci_set_uhs_signaling,
};
--
2.11.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] sdhci: key 8BITBUS bit off MMC_CAP_8_BIT_DATA
[not found] ` <96ece1eb7b8f6e188e3975f75754aeaf195f3dc0.1502310654.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
@ 2017-08-14 11:58 ` Adrian Hunter
0 siblings, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2017-08-14 11:58 UTC (permalink / raw)
To: Michał Mirosław, Ulf Hansson, Thierry Reding,
Jonathan Hunter, Ben Dooks, Jaehoon Chung
Cc: linux-mmc-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On 09/08/17 23:36, Michał Mirosław wrote:
>
> Hosts supporting 8-bit bus are marked accordingly. If MMC_CAP_8_BIT_DATA
> is not among host capabilities, 8BITBUS bit will never be set and it
> is not cleared in case some non-SDHCI3 host uses it for something else.
>
> Signed-off-by: Michał Mirosław <mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
Subject should begin "mmc: sdhci: "...
Otherwise:
Acked-by: Adrian Hunter <adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> drivers/mmc/host/sdhci.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index ecd0d4350e8a..cca21246cf61 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1544,10 +1544,9 @@ void sdhci_set_bus_width(struct sdhci_host *host, int width)
> ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> if (width == MMC_BUS_WIDTH_8) {
> ctrl &= ~SDHCI_CTRL_4BITBUS;
> - if (host->version >= SDHCI_SPEC_300)
> - ctrl |= SDHCI_CTRL_8BITBUS;
> + ctrl |= SDHCI_CTRL_8BITBUS;
> } else {
> - if (host->version >= SDHCI_SPEC_300)
> + if (host->mmc->caps & MMC_CAP_8_BIT_DATA)
> ctrl &= ~SDHCI_CTRL_8BITBUS;
> if (width == MMC_BUS_WIDTH_4)
> ctrl |= SDHCI_CTRL_4BITBUS;
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/4] mmc/sdhci-tegra: use generic sdhci_set_bus_width()
2017-08-09 20:36 ` [PATCH 2/4] mmc/sdhci-tegra: use generic sdhci_set_bus_width() Michał Mirosław
@ 2017-08-14 12:03 ` Adrian Hunter
0 siblings, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2017-08-14 12:03 UTC (permalink / raw)
To: Michał Mirosław, Ulf Hansson, Thierry Reding,
Jonathan Hunter, Ben Dooks, Jaehoon Chung
Cc: linux-mmc, linux-tegra
On 09/08/17 23:36, Michał Mirosław wrote:
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
There always needs to be a commit message. i.e.
"Now that sdhci_set_bus_width() supports 8-bit bus widths based on the
MMC_CAP_8_BIT_DATA capability flag, replace the tegra version with the
generic sdhci version."
Also subject should begin "mmc: sdhci-tegra: "...
Otherwise:
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci-tegra.c | 23 ++---------------------
> 1 file changed, 2 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> index 7f93079c7a3a..9a589b6a53dd 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -190,25 +190,6 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
> tegra_host->ddr_signaling = false;
> }
>
> -static void tegra_sdhci_set_bus_width(struct sdhci_host *host, int bus_width)
> -{
> - u32 ctrl;
> -
> - ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> - if ((host->mmc->caps & MMC_CAP_8_BIT_DATA) &&
> - (bus_width == MMC_BUS_WIDTH_8)) {
> - ctrl &= ~SDHCI_CTRL_4BITBUS;
> - ctrl |= SDHCI_CTRL_8BITBUS;
> - } else {
> - ctrl &= ~SDHCI_CTRL_8BITBUS;
> - if (bus_width == MMC_BUS_WIDTH_4)
> - ctrl |= SDHCI_CTRL_4BITBUS;
> - else
> - ctrl &= ~SDHCI_CTRL_4BITBUS;
> - }
> - sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
> -}
> -
> static void tegra_sdhci_pad_autocalib(struct sdhci_host *host)
> {
> u32 val;
> @@ -323,7 +304,7 @@ static const struct sdhci_ops tegra_sdhci_ops = {
> .read_w = tegra_sdhci_readw,
> .write_l = tegra_sdhci_writel,
> .set_clock = tegra_sdhci_set_clock,
> - .set_bus_width = tegra_sdhci_set_bus_width,
> + .set_bus_width = sdhci_set_bus_width,
> .reset = tegra_sdhci_reset,
> .platform_execute_tuning = tegra_sdhci_execute_tuning,
> .set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
> @@ -371,7 +352,7 @@ static const struct sdhci_ops tegra114_sdhci_ops = {
> .write_w = tegra_sdhci_writew,
> .write_l = tegra_sdhci_writel,
> .set_clock = tegra_sdhci_set_clock,
> - .set_bus_width = tegra_sdhci_set_bus_width,
> + .set_bus_width = sdhci_set_bus_width,
> .reset = tegra_sdhci_reset,
> .platform_execute_tuning = tegra_sdhci_execute_tuning,
> .set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/4] mmc/sdhci-pci: use generic sdhci_set_bus_width()
[not found] ` <b1a072bfd9f9d7934bef982e4a94734eccf0b8e4.1502310654.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
@ 2017-08-14 12:04 ` Adrian Hunter
0 siblings, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2017-08-14 12:04 UTC (permalink / raw)
To: Michał Mirosław, Ulf Hansson, Thierry Reding,
Jonathan Hunter, Ben Dooks, Jaehoon Chung
Cc: linux-mmc-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On 09/08/17 23:36, Michał Mirosław wrote:
> Signed-off-by: Michał Mirosław <mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
There always needs to be a commit message. i.e.
"Now that sdhci_set_bus_width() supports 8-bit bus widths based on the
MMC_CAP_8_BIT_DATA capability flag, replace the sdhci-pci version with the
generic sdhci version."
Also subject should begin "mmc: sdhci-pci: "...
Otherwise:
Acked-by: Adrian Hunter <adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> drivers/mmc/host/sdhci-pci-core.c | 30 +++---------------------------
> 1 file changed, 3 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index 92fc3f7c538d..dfe217e7fbfe 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -35,7 +35,6 @@
> #include "sdhci-pci-o2micro.h"
>
> static int sdhci_pci_enable_dma(struct sdhci_host *host);
> -static void sdhci_pci_set_bus_width(struct sdhci_host *host, int width);
> static void sdhci_pci_hw_reset(struct sdhci_host *host);
>
> #ifdef CONFIG_PM_SLEEP
> @@ -547,7 +546,7 @@ static const struct sdhci_ops sdhci_intel_byt_ops = {
> .set_clock = sdhci_set_clock,
> .set_power = sdhci_intel_set_power,
> .enable_dma = sdhci_pci_enable_dma,
> - .set_bus_width = sdhci_pci_set_bus_width,
> + .set_bus_width = sdhci_set_bus_width,
> .reset = sdhci_reset,
> .set_uhs_signaling = sdhci_set_uhs_signaling,
> .hw_reset = sdhci_pci_hw_reset,
> @@ -1159,7 +1158,7 @@ static int amd_probe(struct sdhci_pci_chip *chip)
> static const struct sdhci_ops amd_sdhci_pci_ops = {
> .set_clock = sdhci_set_clock,
> .enable_dma = sdhci_pci_enable_dma,
> - .set_bus_width = sdhci_pci_set_bus_width,
> + .set_bus_width = sdhci_set_bus_width,
> .reset = sdhci_reset,
> .set_uhs_signaling = sdhci_set_uhs_signaling,
> .platform_execute_tuning = amd_execute_tuning,
> @@ -1750,29 +1749,6 @@ static int sdhci_pci_enable_dma(struct sdhci_host *host)
> return 0;
> }
>
> -static void sdhci_pci_set_bus_width(struct sdhci_host *host, int width)
> -{
> - u8 ctrl;
> -
> - ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> -
> - switch (width) {
> - case MMC_BUS_WIDTH_8:
> - ctrl |= SDHCI_CTRL_8BITBUS;
> - ctrl &= ~SDHCI_CTRL_4BITBUS;
> - break;
> - case MMC_BUS_WIDTH_4:
> - ctrl |= SDHCI_CTRL_4BITBUS;
> - ctrl &= ~SDHCI_CTRL_8BITBUS;
> - break;
> - default:
> - ctrl &= ~(SDHCI_CTRL_8BITBUS | SDHCI_CTRL_4BITBUS);
> - break;
> - }
> -
> - sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
> -}
> -
> static void sdhci_pci_gpio_hw_reset(struct sdhci_host *host)
> {
> struct sdhci_pci_slot *slot = sdhci_priv(host);
> @@ -1799,7 +1775,7 @@ static void sdhci_pci_hw_reset(struct sdhci_host *host)
> static const struct sdhci_ops sdhci_pci_ops = {
> .set_clock = sdhci_set_clock,
> .enable_dma = sdhci_pci_enable_dma,
> - .set_bus_width = sdhci_pci_set_bus_width,
> + .set_bus_width = sdhci_set_bus_width,
> .reset = sdhci_reset,
> .set_uhs_signaling = sdhci_set_uhs_signaling,
> .hw_reset = sdhci_pci_hw_reset,
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] mmc/sdhci-s3c: use generic sdhci_set_bus_width()
[not found] ` <4323de12fe8bf8c33211a39a5fb14563fb80f2e9.1502310654.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
@ 2017-08-14 12:05 ` Adrian Hunter
0 siblings, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2017-08-14 12:05 UTC (permalink / raw)
To: Michał Mirosław, Ulf Hansson, Thierry Reding,
Jonathan Hunter, Ben Dooks, Jaehoon Chung
Cc: linux-mmc-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On 09/08/17 23:36, Michał Mirosław wrote:
> Signed-off-by: Michał Mirosław <mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
There always needs to be a commit message. i.e.
"Now that sdhci_set_bus_width() supports 8-bit bus widths based on the
MMC_CAP_8_BIT_DATA capability flag, replace the sdhci-s3c version with the
generic sdhci version."
Also subject should begin "mmc: sdhci-s3c: "...
Otherwise:
Acked-by: Adrian Hunter <adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> drivers/mmc/host/sdhci-s3c.c | 34 +---------------------------------
> 1 file changed, 1 insertion(+), 33 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 7c065a70f92b..d328fcf284d1 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -414,43 +414,11 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock)
> sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
> }
>
> -/**
> - * sdhci_s3c_set_bus_width - support 8bit buswidth
> - * @host: The SDHCI host being queried
> - * @width: MMC_BUS_WIDTH_ macro for the bus width being requested
> - *
> - * We have 8-bit width support but is not a v3 controller.
> - * So we add platform_bus_width() and support 8bit width.
> - */
> -static void sdhci_s3c_set_bus_width(struct sdhci_host *host, int width)
> -{
> - u8 ctrl;
> -
> - ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> -
> - switch (width) {
> - case MMC_BUS_WIDTH_8:
> - ctrl |= SDHCI_CTRL_8BITBUS;
> - ctrl &= ~SDHCI_CTRL_4BITBUS;
> - break;
> - case MMC_BUS_WIDTH_4:
> - ctrl |= SDHCI_CTRL_4BITBUS;
> - ctrl &= ~SDHCI_CTRL_8BITBUS;
> - break;
> - default:
> - ctrl &= ~SDHCI_CTRL_4BITBUS;
> - ctrl &= ~SDHCI_CTRL_8BITBUS;
> - break;
> - }
> -
> - sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
> -}
> -
> static struct sdhci_ops sdhci_s3c_ops = {
> .get_max_clock = sdhci_s3c_get_max_clk,
> .set_clock = sdhci_s3c_set_clock,
> .get_min_clock = sdhci_s3c_get_min_clock,
> - .set_bus_width = sdhci_s3c_set_bus_width,
> + .set_bus_width = sdhci_set_bus_width,
> .reset = sdhci_reset,
> .set_uhs_signaling = sdhci_set_uhs_signaling,
> };
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-08-14 12:09 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09 20:36 [PATCH 0/4] mmc/sdhci: sdhci_set_bus_width() cleanup Michał Mirosław
2017-08-09 20:36 ` [PATCH 1/4] sdhci: key 8BITBUS bit off MMC_CAP_8_BIT_DATA Michał Mirosław
[not found] ` <96ece1eb7b8f6e188e3975f75754aeaf195f3dc0.1502310654.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2017-08-14 11:58 ` Adrian Hunter
2017-08-09 20:36 ` [PATCH 2/4] mmc/sdhci-tegra: use generic sdhci_set_bus_width() Michał Mirosław
2017-08-14 12:03 ` Adrian Hunter
2017-08-09 20:36 ` [PATCH 3/4] mmc/sdhci-pci: " Michał Mirosław
[not found] ` <b1a072bfd9f9d7934bef982e4a94734eccf0b8e4.1502310654.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2017-08-14 12:04 ` Adrian Hunter
2017-08-09 20:36 ` [PATCH 4/4] mmc/sdhci-s3c: " Michał Mirosław
[not found] ` <4323de12fe8bf8c33211a39a5fb14563fb80f2e9.1502310654.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2017-08-14 12:05 ` Adrian Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox