* [MXS MMC v2 1/4] Fix grammatical error in comment
2011-12-08 8:17 [MXS MMC v2 0/4] Some cleanups and fixes for the MXS MMC subsystem Lothar Waßmann
@ 2011-12-08 8:17 ` Lothar Waßmann
2011-12-08 8:52 ` Wolfram Sang
2011-12-08 8:17 ` [MXS MMC v2 2/4] Some cleanups for the MMC driver Lothar Waßmann
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Lothar Waßmann @ 2011-12-08 8:17 UTC (permalink / raw)
To: Shawn Guo
Cc: Sascha Hauer, linux-mmc, linux-arm-kernel, linux-kernel,
Chris Ball, Lothar Waßmann
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-mxs/clock-mx28.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index da6e4aa..fc86b04 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -554,7 +554,7 @@ static struct clk rtc_clk = {
.parent = &ref_xtal_clk,
};
-/* usb_clk gate is controlled in DIGCTRL other than CLKCTRL */
+/* usb_clk gate is controlled in DIGCTRL rather than CLKCTRL */
static struct clk usb0_clk = {
.enable_reg = DIGCTRL_BASE_ADDR,
.enable_shift = 2,
--
1.5.6.5
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [MXS MMC v2 1/4] Fix grammatical error in comment
2011-12-08 8:17 ` [MXS MMC v2 1/4] Fix grammatical error in comment Lothar Waßmann
@ 2011-12-08 8:52 ` Wolfram Sang
0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2011-12-08 8:52 UTC (permalink / raw)
To: Lothar Waßmann
Cc: Shawn Guo, Sascha Hauer, linux-mmc, linux-arm-kernel,
linux-kernel, Chris Ball
[-- Attachment #1: Type: text/plain, Size: 380 bytes --]
On Thu, Dec 08, 2011 at 09:17:44AM +0100, Lothar Waßmann wrote:
>
> Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [MXS MMC v2 2/4] Some cleanups for the MMC driver
2011-12-08 8:17 [MXS MMC v2 0/4] Some cleanups and fixes for the MXS MMC subsystem Lothar Waßmann
2011-12-08 8:17 ` [MXS MMC v2 1/4] Fix grammatical error in comment Lothar Waßmann
@ 2011-12-08 8:17 ` Lothar Waßmann
2011-12-08 9:17 ` Shawn Guo
2011-12-08 8:17 ` [MXS MMC v2 3/4] Check the return codes of clk_enable() and mxs_reset_block() Lothar Waßmann
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Lothar Waßmann @ 2011-12-08 8:17 UTC (permalink / raw)
To: Shawn Guo
Cc: Sascha Hauer, linux-mmc, linux-arm-kernel, linux-kernel,
Chris Ball, Lothar Waßmann
- Remove bogus parens around numerical arguments in #define's
- When defining bit masks, use the #def for the shift count
instead of repeating the numbers
- Remove 'break' at end of switch statement
Changes wrt v1:
- break long lines
- leave indentation as is
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
drivers/mmc/host/mxs-mmc.c | 60 ++++++++++++++++++++++++---------------------
1 file changed, 32 insertions(+), 28 deletions(-)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 99b449d..a9b70d2 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -47,7 +47,7 @@
#define DRIVER_NAME "mxs-mmc"
/* card detect polling timeout */
-#define MXS_MMC_DETECT_TIMEOUT (HZ/2)
+#define MXS_MMC_DETECT_TIMEOUT (HZ / 2)
#define SSP_VERSION_LATEST 4
#define ssp_is_old() (host->version < SSP_VERSION_LATEST)
@@ -59,39 +59,43 @@
#define BM_SSP_CTRL0_IGNORE_CRC (1 << 26)
#define BM_SSP_CTRL0_READ (1 << 25)
#define BM_SSP_CTRL0_DATA_XFER (1 << 24)
-#define BP_SSP_CTRL0_BUS_WIDTH (22)
-#define BM_SSP_CTRL0_BUS_WIDTH (0x3 << 22)
+#define BP_SSP_CTRL0_BUS_WIDTH 22
+#define BM_SSP_CTRL0_BUS_WIDTH (0x3 << BP_SSP_CTRL0_BUS_WIDTH)
#define BM_SSP_CTRL0_WAIT_FOR_IRQ (1 << 21)
#define BM_SSP_CTRL0_LONG_RESP (1 << 19)
#define BM_SSP_CTRL0_GET_RESP (1 << 17)
#define BM_SSP_CTRL0_ENABLE (1 << 16)
-#define BP_SSP_CTRL0_XFER_COUNT (0)
-#define BM_SSP_CTRL0_XFER_COUNT (0xffff)
+#define BP_SSP_CTRL0_XFER_COUNT 0
+#define BM_SSP_CTRL0_XFER_COUNT 0xffff
#define HW_SSP_CMD0 0x010
#define BM_SSP_CMD0_DBL_DATA_RATE_EN (1 << 25)
#define BM_SSP_CMD0_SLOW_CLKING_EN (1 << 22)
#define BM_SSP_CMD0_CONT_CLKING_EN (1 << 21)
#define BM_SSP_CMD0_APPEND_8CYC (1 << 20)
-#define BP_SSP_CMD0_BLOCK_SIZE (16)
-#define BM_SSP_CMD0_BLOCK_SIZE (0xf << 16)
-#define BP_SSP_CMD0_BLOCK_COUNT (8)
-#define BM_SSP_CMD0_BLOCK_COUNT (0xff << 8)
-#define BP_SSP_CMD0_CMD (0)
-#define BM_SSP_CMD0_CMD (0xff)
+#define BP_SSP_CMD0_BLOCK_SIZE 16
+#define BM_SSP_CMD0_BLOCK_SIZE (0xf << BP_SSP_CMD0_BLOCK_SIZE)
+#define BP_SSP_CMD0_BLOCK_COUNT 8
+#define BM_SSP_CMD0_BLOCK_COUNT \
+ (0xff << BP_SSP_CMD0_BLOCK_COUNT)
+#define BP_SSP_CMD0_CMD 0
+#define BM_SSP_CMD0_CMD 0xff
#define HW_SSP_CMD1 0x020
#define HW_SSP_XFER_SIZE 0x030
#define HW_SSP_BLOCK_SIZE 0x040
-#define BP_SSP_BLOCK_SIZE_BLOCK_COUNT (4)
-#define BM_SSP_BLOCK_SIZE_BLOCK_COUNT (0xffffff << 4)
-#define BP_SSP_BLOCK_SIZE_BLOCK_SIZE (0)
-#define BM_SSP_BLOCK_SIZE_BLOCK_SIZE (0xf)
+#define BP_SSP_BLOCK_SIZE_BLOCK_COUNT 4
+#define BM_SSP_BLOCK_SIZE_BLOCK_COUNT \
+ (0xffffff << BP_SSP_BLOCK_SIZE_BLOCK_COUNT)
+#define BP_SSP_BLOCK_SIZE_BLOCK_SIZE 0
+#define BM_SSP_BLOCK_SIZE_BLOCK_SIZE 0xf
#define HW_SSP_TIMING (ssp_is_old() ? 0x050 : 0x070)
-#define BP_SSP_TIMING_TIMEOUT (16)
-#define BM_SSP_TIMING_TIMEOUT (0xffff << 16)
-#define BP_SSP_TIMING_CLOCK_DIVIDE (8)
-#define BM_SSP_TIMING_CLOCK_DIVIDE (0xff << 8)
-#define BP_SSP_TIMING_CLOCK_RATE (0)
-#define BM_SSP_TIMING_CLOCK_RATE (0xff)
+#define BP_SSP_TIMING_TIMEOUT 16
+#define BM_SSP_TIMING_TIMEOUT \
+ (0xffff << BP_SSP_TIMING_TIMEOUT)
+#define BP_SSP_TIMING_CLOCK_DIVIDE 8
+#define BM_SSP_TIMING_CLOCK_DIVIDE \
+ (0xff << BP_SSP_TIMING_CLOCK_DIVIDE)
+#define BP_SSP_TIMING_CLOCK_RATE 0
+#define BM_SSP_TIMING_CLOCK_RATE 0xff
#define HW_SSP_CTRL1 (ssp_is_old() ? 0x060 : 0x080)
#define BM_SSP_CTRL1_SDIO_IRQ (1 << 31)
#define BM_SSP_CTRL1_SDIO_IRQ_EN (1 << 30)
@@ -111,10 +115,11 @@
#define BM_SSP_CTRL1_FIFO_OVERRUN_IRQ_EN (1 << 14)
#define BM_SSP_CTRL1_DMA_ENABLE (1 << 13)
#define BM_SSP_CTRL1_POLARITY (1 << 9)
-#define BP_SSP_CTRL1_WORD_LENGTH (4)
-#define BM_SSP_CTRL1_WORD_LENGTH (0xf << 4)
-#define BP_SSP_CTRL1_SSP_MODE (0)
-#define BM_SSP_CTRL1_SSP_MODE (0xf)
+#define BP_SSP_CTRL1_WORD_LENGTH 4
+#define BM_SSP_CTRL1_WORD_LENGTH \
+ (0xf << BP_SSP_CTRL1_WORD_LENGTH)
+#define BP_SSP_CTRL1_SSP_MODE 0
+#define BM_SSP_CTRL1_SSP_MODE 0xf
#define HW_SSP_SDRESP0 (ssp_is_old() ? 0x080 : 0x0a0)
#define HW_SSP_SDRESP1 (ssp_is_old() ? 0x090 : 0x0b0)
#define HW_SSP_SDRESP2 (ssp_is_old() ? 0x0a0 : 0x0c0)
@@ -123,7 +128,7 @@
#define BM_SSP_STATUS_CARD_DETECT (1 << 28)
#define BM_SSP_STATUS_SDIO_IRQ (1 << 17)
#define HW_SSP_VERSION (cpu_is_mx23() ? 0x110 : 0x130)
-#define BP_SSP_VERSION_MAJOR (24)
+#define BP_SSP_VERSION_MAJOR 24
#define BF_SSP(value, field) (((value) << BP_SSP_##field) & BM_SSP_##field)
@@ -151,7 +156,7 @@ struct mxs_mmc_host {
struct clk *clk;
unsigned int clk_rate;
- struct dma_chan *dmach;
+ struct dma_chan *dmach;
struct mxs_dma_data dma_data;
unsigned int dma_dir;
u32 ssp_pio_words[SSP_PIO_NUM];
@@ -550,7 +555,6 @@ static void mxs_mmc_start_cmd(struct mxs_mmc_host *host,
default:
dev_warn(mmc_dev(host->mmc),
"%s: unknown MMC command\n", __func__);
- break;
}
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [MXS MMC v2 2/4] Some cleanups for the MMC driver
2011-12-08 8:17 ` [MXS MMC v2 2/4] Some cleanups for the MMC driver Lothar Waßmann
@ 2011-12-08 9:17 ` Shawn Guo
0 siblings, 0 replies; 10+ messages in thread
From: Shawn Guo @ 2011-12-08 9:17 UTC (permalink / raw)
To: Lothar Waßmann
Cc: Shawn Guo, Sascha Hauer, linux-mmc, linux-arm-kernel,
linux-kernel, Chris Ball
On Thu, Dec 08, 2011 at 09:17:45AM +0100, Lothar Waßmann wrote:
> - Remove bogus parens around numerical arguments in #define's
> - When defining bit masks, use the #def for the shift count
> instead of repeating the numbers
> - Remove 'break' at end of switch statement
>
> Changes wrt v1:
> - break long lines
> - leave indentation as is
>
> Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Not sure if Chris will ask you to add proper subject prefix though :)
--
Regards,
Shawn
^ permalink raw reply [flat|nested] 10+ messages in thread
* [MXS MMC v2 3/4] Check the return codes of clk_enable() and mxs_reset_block()
2011-12-08 8:17 [MXS MMC v2 0/4] Some cleanups and fixes for the MXS MMC subsystem Lothar Waßmann
2011-12-08 8:17 ` [MXS MMC v2 1/4] Fix grammatical error in comment Lothar Waßmann
2011-12-08 8:17 ` [MXS MMC v2 2/4] Some cleanups for the MMC driver Lothar Waßmann
@ 2011-12-08 8:17 ` Lothar Waßmann
2011-12-08 8:53 ` Wolfram Sang
2011-12-08 8:17 ` [MXS MMC 4/4] Add an appropriate MODULE_ALIAS Lothar Waßmann
2011-12-08 8:52 ` [MXS MMC v2 0/4] Some cleanups and fixes for the MXS MMC subsystem Wolfram Sang
4 siblings, 1 reply; 10+ messages in thread
From: Lothar Waßmann @ 2011-12-08 8:17 UTC (permalink / raw)
To: Shawn Guo
Cc: Sascha Hauer, linux-mmc, linux-arm-kernel, linux-kernel,
Chris Ball, Lothar Waßmann
Add an int return value to mxs_mmc_reset(), so that the return code of
mxs_reset_block() can be promoted to the caller.
Also check the return code of clk_enable() in the probe function.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/mmc/host/mxs-mmc.c | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index a9b70d2..0003d03 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -190,11 +190,14 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
BM_SSP_STATUS_CARD_DETECT);
}
-static void mxs_mmc_reset(struct mxs_mmc_host *host)
+static int mxs_mmc_reset(struct mxs_mmc_host *host)
{
+ int ret;
u32 ctrl0, ctrl1;
- mxs_reset_block(host->base);
+ ret = mxs_reset_block(host->base);
+ if (ret)
+ return ret;
ctrl0 = BM_SSP_CTRL0_IGNORE_CRC;
ctrl1 = BF_SSP(0x3, CTRL1_SSP_MODE) |
@@ -219,6 +222,7 @@ static void mxs_mmc_reset(struct mxs_mmc_host *host)
writel(ctrl0, host->base + HW_SSP_CTRL0);
writel(ctrl1, host->base + HW_SSP_CTRL1);
+ return 0;
}
static void mxs_mmc_start_cmd(struct mxs_mmc_host *host,
@@ -717,9 +721,19 @@ static int mxs_mmc_probe(struct platform_device *pdev)
ret = PTR_ERR(host->clk);
goto out_iounmap;
}
- clk_enable(host->clk);
+ ret = clk_enable(host->clk);
+ if (ret) {
+ dev_err(mmc_dev(host->mmc),
+ "%s: failed to enable clock: %d\n", __func__, ret);
+ goto out_clk_put;
+ }
- mxs_mmc_reset(host);
+ ret = mxs_mmc_reset(host);
+ if (ret) {
+ dev_err(mmc_dev(host->mmc),
+ "%s: failed to reset controller: %d\n", __func__, ret);
+ goto out_clk_put;
+ }
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
@@ -834,7 +848,9 @@ static int mxs_mmc_resume(struct device *dev)
struct mxs_mmc_host *host = mmc_priv(mmc);
int ret = 0;
- clk_enable(host->clk);
+ ret = clk_enable(host->clk);
+ if (ret)
+ return ret;
ret = mmc_resume_host(mmc);
--
1.5.6.5
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [MXS MMC v2 3/4] Check the return codes of clk_enable() and mxs_reset_block()
2011-12-08 8:17 ` [MXS MMC v2 3/4] Check the return codes of clk_enable() and mxs_reset_block() Lothar Waßmann
@ 2011-12-08 8:53 ` Wolfram Sang
0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2011-12-08 8:53 UTC (permalink / raw)
To: Lothar Waßmann
Cc: Shawn Guo, Sascha Hauer, linux-mmc, linux-arm-kernel,
linux-kernel, Chris Ball
[-- Attachment #1: Type: text/plain, Size: 640 bytes --]
On Thu, Dec 08, 2011 at 09:17:46AM +0100, Lothar Waßmann wrote:
> Add an int return value to mxs_mmc_reset(), so that the return code of
> mxs_reset_block() can be promoted to the caller.
> Also check the return code of clk_enable() in the probe function.
>
> Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
Despite minor nit that using __func__ is probably overkill:
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [MXS MMC 4/4] Add an appropriate MODULE_ALIAS
2011-12-08 8:17 [MXS MMC v2 0/4] Some cleanups and fixes for the MXS MMC subsystem Lothar Waßmann
` (2 preceding siblings ...)
2011-12-08 8:17 ` [MXS MMC v2 3/4] Check the return codes of clk_enable() and mxs_reset_block() Lothar Waßmann
@ 2011-12-08 8:17 ` Lothar Waßmann
2011-12-08 8:54 ` Wolfram Sang
2011-12-08 8:52 ` [MXS MMC v2 0/4] Some cleanups and fixes for the MXS MMC subsystem Wolfram Sang
4 siblings, 1 reply; 10+ messages in thread
From: Lothar Waßmann @ 2011-12-08 8:17 UTC (permalink / raw)
To: Shawn Guo
Cc: Sascha Hauer, linux-mmc, linux-arm-kernel, linux-kernel,
Chris Ball, Lothar Waßmann
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/mmc/host/mxs-mmc.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 0003d03..1ba08ae 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -891,3 +891,4 @@ module_exit(mxs_mmc_exit);
MODULE_DESCRIPTION("FREESCALE MXS MMC peripheral");
MODULE_AUTHOR("Freescale Semiconductor");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:mxs-mmc");
--
1.5.6.5
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [MXS MMC 4/4] Add an appropriate MODULE_ALIAS
2011-12-08 8:17 ` [MXS MMC 4/4] Add an appropriate MODULE_ALIAS Lothar Waßmann
@ 2011-12-08 8:54 ` Wolfram Sang
0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2011-12-08 8:54 UTC (permalink / raw)
To: Lothar Waßmann
Cc: Shawn Guo, Sascha Hauer, linux-mmc, linux-arm-kernel,
linux-kernel, Chris Ball
[-- Attachment #1: Type: text/plain, Size: 382 bytes --]
On Thu, Dec 08, 2011 at 09:17:47AM +0100, Lothar Waßmann wrote:
>
> Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [MXS MMC v2 0/4] Some cleanups and fixes for the MXS MMC subsystem
2011-12-08 8:17 [MXS MMC v2 0/4] Some cleanups and fixes for the MXS MMC subsystem Lothar Waßmann
` (3 preceding siblings ...)
2011-12-08 8:17 ` [MXS MMC 4/4] Add an appropriate MODULE_ALIAS Lothar Waßmann
@ 2011-12-08 8:52 ` Wolfram Sang
4 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2011-12-08 8:52 UTC (permalink / raw)
To: Lothar Waßmann
Cc: Shawn Guo, Sascha Hauer, linux-mmc, linux-arm-kernel,
linux-kernel, Chris Ball
[-- Attachment #1: Type: text/plain, Size: 231 bytes --]
> - add Acked-by: where applicable
You forgot mine :( Will resend.
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread