mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mci: mxs: support overwriting the device name via platform data
@ 2013-11-07 10:51 Uwe Kleine-König
  2013-11-07 16:04 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2013-11-07 10:51 UTC (permalink / raw)
  To: barebox

The current implementation of the bootloader specification depends on the
hardware name and the name of the device in /dev to match. As the default
hardware name is mciX and the device name is diskY the bootloader spec
cannot be used as is.

This patch implements a way to overwrite the device name similar to what is
possible for the imx-esdhc driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-mxs/include/mach/mci.h | 1 +
 drivers/mci/mxs.c                    | 3 +++
 include/mci.h                        | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-mxs/include/mach/mci.h b/arch/arm/mach-mxs/include/mach/mci.h
index 4faab37..c47c24c 100644
--- a/arch/arm/mach-mxs/include/mach/mci.h
+++ b/arch/arm/mach-mxs/include/mach/mci.h
@@ -15,6 +15,7 @@
 #define __MACH_MMC_H
 
 struct mxs_mci_platform_data {
+	const char *devname;
 	unsigned caps;	/**< supported operating modes (MMC_MODE_*) */
 	unsigned voltages; /**< supported voltage range (MMC_VDD_*) */
 	unsigned f_min;	/**< min operating frequency in Hz (0 -> no limit) */
diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c
index 1b935f7..52d0656 100644
--- a/drivers/mci/mxs.c
+++ b/drivers/mci/mxs.c
@@ -571,6 +571,9 @@ static int mxs_mci_probe(struct device_d *hw_dev)
 	host->voltages = pd->voltages;
 	host->host_caps = pd->caps;
 
+	if (pd->devname)
+		host->devname = pd->devname;
+
 	mxs_mci->clk = clk_get(hw_dev, NULL);
 	if (IS_ERR(mxs_mci->clk))
 		return PTR_ERR(mxs_mci->clk);
diff --git a/include/mci.h b/include/mci.h
index 1ca00c7..72729b6 100644
--- a/include/mci.h
+++ b/include/mci.h
@@ -286,7 +286,7 @@ struct mci;
 struct mci_host {
 	struct device_d *hw_dev;	/**< the host MCI hardware device */
 	struct mci *mci;
-	char *devname;			/**< the devicename for the card, defaults to disk%d */
+	const char *devname;		/**< the devicename for the card, defaults to disk%d */
 	unsigned voltages;
 	unsigned host_caps;	/**< Host's interface capabilities, refer MMC_VDD_* */
 	unsigned f_min;		/**< host interface lower limit */
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mci: mxs: support overwriting the device name via platform data
  2013-11-07 10:51 [PATCH] mci: mxs: support overwriting the device name via platform data Uwe Kleine-König
@ 2013-11-07 16:04 ` Jean-Christophe PLAGNIOL-VILLARD
  2013-11-08  0:11   ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-11-07 16:04 UTC (permalink / raw)
  To: Uwe Kleine-K??nig; +Cc: barebox

On 11:51 Thu 07 Nov     , Uwe Kleine-K??nig wrote:
> The current implementation of the bootloader specification depends on the
> hardware name and the name of the device in /dev to match. As the default
> hardware name is mciX and the device name is diskY the bootloader spec
> cannot be used as is.
> 
> This patch implements a way to overwrite the device name similar to what is
> possible for the imx-esdhc driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  arch/arm/mach-mxs/include/mach/mci.h | 1 +
>  drivers/mci/mxs.c                    | 3 +++
>  include/mci.h                        | 2 +-
>  3 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-mxs/include/mach/mci.h b/arch/arm/mach-mxs/include/mach/mci.h
> index 4faab37..c47c24c 100644
> --- a/arch/arm/mach-mxs/include/mach/mci.h
> +++ b/arch/arm/mach-mxs/include/mach/mci.h
> @@ -15,6 +15,7 @@
>  #define __MACH_MMC_H
>  
>  struct mxs_mci_platform_data {
> +	const char *devname;
>  	unsigned caps;	/**< supported operating modes (MMC_MODE_*) */
>  	unsigned voltages; /**< supported voltage range (MMC_VDD_*) */
>  	unsigned f_min;	/**< min operating frequency in Hz (0 -> no limit) */
> diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c
> index 1b935f7..52d0656 100644
> --- a/drivers/mci/mxs.c
> +++ b/drivers/mci/mxs.c
> @@ -571,6 +571,9 @@ static int mxs_mci_probe(struct device_d *hw_dev)
>  	host->voltages = pd->voltages;
>  	host->host_caps = pd->caps;
>  
> +	if (pd->devname)
> +		host->devname = pd->devname;

why bother to test it?

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] mci: mxs: support overwriting the device name via platform data
  2013-11-07 16:04 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-11-08  0:11   ` Uwe Kleine-König
  2013-11-11 10:16     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2013-11-08  0:11 UTC (permalink / raw)
  To: barebox

The current implementation of the bootloader specification depends on the
hardware name and the name of the device in /dev to match. As the default
hardware name is mciX and the device name is diskY the bootloader spec
cannot be used as is.

This patch implements a way to overwrite the device name similar to what is
possible for the imx-esdhc driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---

Notes:
    Changes since (implicit) v1, sent with
    Message-Id: 1383821462-29348-1-git-send-email-u.kleine-koenig@pengutronix.de:
    
     - don't check for pd->devname being non-NULL before assigment as suggested
       by Jean-Christophe.

 arch/arm/mach-mxs/include/mach/mci.h | 1 +
 drivers/mci/mxs.c                    | 1 +
 include/mci.h                        | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-mxs/include/mach/mci.h b/arch/arm/mach-mxs/include/mach/mci.h
index 4faab37..c47c24c 100644
--- a/arch/arm/mach-mxs/include/mach/mci.h
+++ b/arch/arm/mach-mxs/include/mach/mci.h
@@ -15,6 +15,7 @@
 #define __MACH_MMC_H
 
 struct mxs_mci_platform_data {
+	const char *devname;
 	unsigned caps;	/**< supported operating modes (MMC_MODE_*) */
 	unsigned voltages; /**< supported voltage range (MMC_VDD_*) */
 	unsigned f_min;	/**< min operating frequency in Hz (0 -> no limit) */
diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c
index 1b935f7..bf928e8 100644
--- a/drivers/mci/mxs.c
+++ b/drivers/mci/mxs.c
@@ -570,6 +570,7 @@ static int mxs_mci_probe(struct device_d *hw_dev)
 	/* feed forward the platform specific values */
 	host->voltages = pd->voltages;
 	host->host_caps = pd->caps;
+	host->devname = pd->devname;
 
 	mxs_mci->clk = clk_get(hw_dev, NULL);
 	if (IS_ERR(mxs_mci->clk))
diff --git a/include/mci.h b/include/mci.h
index 07ac273..0f10e8a 100644
--- a/include/mci.h
+++ b/include/mci.h
@@ -286,7 +286,7 @@ struct mci;
 struct mci_host {
 	struct device_d *hw_dev;	/**< the host MCI hardware device */
 	struct mci *mci;
-	char *devname;			/**< the devicename for the card, defaults to disk%d */
+	const char *devname;		/**< the devicename for the card, defaults to disk%d */
 	unsigned voltages;
 	unsigned host_caps;	/**< Host's interface capabilities, refer MMC_VDD_* */
 	unsigned f_min;		/**< host interface lower limit */
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mci: mxs: support overwriting the device name via platform data
  2013-11-08  0:11   ` Uwe Kleine-König
@ 2013-11-11 10:16     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2013-11-11 10:16 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

On Fri, Nov 08, 2013 at 01:11:57AM +0100, Uwe Kleine-König wrote:
> The current implementation of the bootloader specification depends on the
> hardware name and the name of the device in /dev to match. As the default
> hardware name is mciX and the device name is diskY the bootloader spec
> cannot be used as is.
> 
> This patch implements a way to overwrite the device name similar to what is
> possible for the imx-esdhc driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Applied, thanks

Sascha

> ---
> 
> Notes:
>     Changes since (implicit) v1, sent with
>     Message-Id: 1383821462-29348-1-git-send-email-u.kleine-koenig@pengutronix.de:
>     
>      - don't check for pd->devname being non-NULL before assigment as suggested
>        by Jean-Christophe.
> 
>  arch/arm/mach-mxs/include/mach/mci.h | 1 +
>  drivers/mci/mxs.c                    | 1 +
>  include/mci.h                        | 2 +-
>  3 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-mxs/include/mach/mci.h b/arch/arm/mach-mxs/include/mach/mci.h
> index 4faab37..c47c24c 100644
> --- a/arch/arm/mach-mxs/include/mach/mci.h
> +++ b/arch/arm/mach-mxs/include/mach/mci.h
> @@ -15,6 +15,7 @@
>  #define __MACH_MMC_H
>  
>  struct mxs_mci_platform_data {
> +	const char *devname;
>  	unsigned caps;	/**< supported operating modes (MMC_MODE_*) */
>  	unsigned voltages; /**< supported voltage range (MMC_VDD_*) */
>  	unsigned f_min;	/**< min operating frequency in Hz (0 -> no limit) */
> diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c
> index 1b935f7..bf928e8 100644
> --- a/drivers/mci/mxs.c
> +++ b/drivers/mci/mxs.c
> @@ -570,6 +570,7 @@ static int mxs_mci_probe(struct device_d *hw_dev)
>  	/* feed forward the platform specific values */
>  	host->voltages = pd->voltages;
>  	host->host_caps = pd->caps;
> +	host->devname = pd->devname;
>  
>  	mxs_mci->clk = clk_get(hw_dev, NULL);
>  	if (IS_ERR(mxs_mci->clk))
> diff --git a/include/mci.h b/include/mci.h
> index 07ac273..0f10e8a 100644
> --- a/include/mci.h
> +++ b/include/mci.h
> @@ -286,7 +286,7 @@ struct mci;
>  struct mci_host {
>  	struct device_d *hw_dev;	/**< the host MCI hardware device */
>  	struct mci *mci;
> -	char *devname;			/**< the devicename for the card, defaults to disk%d */
> +	const char *devname;		/**< the devicename for the card, defaults to disk%d */
>  	unsigned voltages;
>  	unsigned host_caps;	/**< Host's interface capabilities, refer MMC_VDD_* */
>  	unsigned f_min;		/**< host interface lower limit */
> -- 
> 1.8.4.rc3
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-11 10:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-07 10:51 [PATCH] mci: mxs: support overwriting the device name via platform data Uwe Kleine-König
2013-11-07 16:04 ` Jean-Christophe PLAGNIOL-VILLARD
2013-11-08  0:11   ` Uwe Kleine-König
2013-11-11 10:16     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox