RE: [PATCH 04/15] mmc: support embedded data field in mmc_host

2010-07-07 Thread Ghorai, Sukumar


 -Original Message-
 From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
 ow...@vger.kernel.org] On Behalf Of Ohad Ben-Cohen
 Sent: Tuesday, July 06, 2010 6:08 AM
 To: linux-wirel...@vger.kernel.org; linux-...@vger.kernel.org; linux-
 o...@vger.kernel.org
 Cc: linux-arm-ker...@lists.infradead.org; li...@arm.linux.org.uk;
 Chikkature Rajashekar, Madhusudhan; Luciano Coelho; a...@linux-
 foundation.org; San Mehat; Ben-cohen, Ohad
 Subject: [PATCH 04/15] mmc: support embedded data field in mmc_host
 
 From: Ohad Ben-Cohen oh...@ti.com
 
 Add support to set/get mmc_host private embedded
 data.
 
 This is needed to allow software to dynamically
 create (and remove) SDIO functions which represents
 embedded SDIO devices.
 
 Typically, it will be used to set the context of
 a driver that is creating a new SDIO function
 (and would then expect to be able to get that context
 back upon creation of the new sdio func).
 
 Signed-off-by: Ohad Ben-Cohen oh...@ti.com
 ---
  drivers/mmc/core/Kconfig |8 
  include/linux/mmc/host.h |   16 
  2 files changed, 24 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/mmc/core/Kconfig b/drivers/mmc/core/Kconfig
 index bb22ffd..ab27eb3 100644
 --- a/drivers/mmc/core/Kconfig
 +++ b/drivers/mmc/core/Kconfig
 @@ -16,3 +16,11 @@ config MMC_UNSAFE_RESUME
 
 This option sets a default which can be overridden by the
 module parameter removable=0 or removable=1.
 +
 +config MMC_EMBEDDED_SDIO
 + boolean MMC embedded SDIO device support
 + help
 +   If you say Y here, support will be added for embedded SDIO
 +   devices (e.g. hardwired embedded WLAN SDIO devices).
 +   Such devices require software support for emulating
 +   card detect events.
 diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
 index f65913c..9a48486 100644
 --- a/include/linux/mmc/host.h
 +++ b/include/linux/mmc/host.h
 @@ -209,6 +209,10 @@ struct mmc_host {
   struct led_trigger  *led;   /* activity led */
  #endif
 
 +#ifdef CONFIG_MMC_EMBEDDED_SDIO
 + void*embedded_data;
 +#endif
 +
   struct dentry   *debugfs_root;
 
   unsigned long   private[0] cacheline_aligned;
 @@ -264,5 +268,17 @@ static inline void mmc_set_disable_delay(struct
 mmc_host *host,
   host-disable_delay = disable_delay;
  }
 
 +#ifdef CONFIG_MMC_EMBEDDED_SDIO
 +static inline void *mmc_get_embedded_data(struct mmc_host *host)
 +{
 + return host-embedded_data;
 +}
 +
 +static inline void mmc_set_embedded_data(struct mmc_host *host, void
 *data)
 +{
 + host-embedded_data = data;
 +}
 +#endif
 +
[Ghorai] we can avoid CONFIG_MMC_EMBEDDED_SDIO flag itself. Why we are passing 
fixed data? We can enquire form card for the functions, features,.. and at 
runtime itself. And we are adding many compile-time/kconfig options in this 
patch series.
  #endif
 
 --
 1.7.0.4
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-mmc in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/15] mmc: support embedded data field in mmc_host

2010-07-06 Thread Grazvydas Ignotas
On Tue, Jul 6, 2010 at 3:37 AM, Ohad Ben-Cohen o...@wizery.com wrote:
 From: Ohad Ben-Cohen oh...@ti.com

 Add support to set/get mmc_host private embedded
 data.

 This is needed to allow software to dynamically
 create (and remove) SDIO functions which represents
 embedded SDIO devices.

 Typically, it will be used to set the context of
 a driver that is creating a new SDIO function
 (and would then expect to be able to get that context
 back upon creation of the new sdio func).

 Signed-off-by: Ohad Ben-Cohen oh...@ti.com
 ---
  drivers/mmc/core/Kconfig |    8 
  include/linux/mmc/host.h |   16 
  2 files changed, 24 insertions(+), 0 deletions(-)

 diff --git a/drivers/mmc/core/Kconfig b/drivers/mmc/core/Kconfig
 index bb22ffd..ab27eb3 100644
 --- a/drivers/mmc/core/Kconfig
 +++ b/drivers/mmc/core/Kconfig
 @@ -16,3 +16,11 @@ config MMC_UNSAFE_RESUME

          This option sets a default which can be overridden by the
          module parameter removable=0 or removable=1.
 +
 +config MMC_EMBEDDED_SDIO
 +       boolean MMC embedded SDIO device support
 +       help
 +         If you say Y here, support will be added for embedded SDIO
 +         devices (e.g. hardwired embedded WLAN SDIO devices).
 +         Such devices require software support for emulating
 +         card detect events.
 diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
 index f65913c..9a48486 100644
 --- a/include/linux/mmc/host.h
 +++ b/include/linux/mmc/host.h
 @@ -209,6 +209,10 @@ struct mmc_host {
        struct led_trigger      *led;           /* activity led */
  #endif

 +#ifdef CONFIG_MMC_EMBEDDED_SDIO
 +       void                    *embedded_data;
 +#endif
 +

Hm, do we really need a Kconfig option just for a single pointer? It
only saves sizeof(void *) bytes per host, but adds rather confusing
config option for users and some ifdef complexity.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/15] mmc: support embedded data field in mmc_host

2010-07-06 Thread Ohad Ben-Cohen
On Tue, Jul 6, 2010 at 6:49 PM, Grazvydas Ignotas nota...@gmail.com wrote:
 Hm, do we really need a Kconfig option just for a single pointer? It
 only saves sizeof(void *) bytes per host, but adds rather confusing
 config option for users and some ifdef complexity.

No strong feelings about it, I can remove that if preferred.


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html