[PATCH] add mmc_host slot_name support

Dan Williams dcbw at redhat.com
Tue Oct 14 08:07:23 PDT 2008


On Mon, 2008-10-13 at 23:18 +0300, Guillem Jover wrote:
> Some OMAP boards support multiple MMC slots, and on current Linux a
> sysfs file might be exposed with this information.
> 
> Add a new slot_name key to mmc_host to identify the slot position, the
> value can be something like 'external'/'internal', or any other unique
> identifier that distinguishes its location from the other possible
> mmc_host present in the Computer.

Are these values standardized anywhere int he kernel?  If not, then
perhaps they should be, or standardized in the HAL spec and HAL should
map between the whacked-out-crazy kernel name, and whatever is in the
HAL spec.  Doesn't do much good to expose a value if there's no
reasonable way to generically figure out what that value actually means.

Dan

>  doc/spec/hal-spec-properties.xml |    8 ++++++++
>  hald/linux/device.c              |    2 ++
>  2 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
> index 636f7bd..3dc80a3 100644
> --- a/doc/spec/hal-spec-properties.xml
> +++ b/doc/spec/hal-spec-properties.xml
> @@ -1909,6 +1909,14 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
>                <entry>Yes</entry>
>                <entry>A unique number identifying the MMC/SD host adaptor</entry>
>              </row>
> +            <row>
> +              <entry>
> +                <literal>mmc_host.slot_name</literal> (string)
> +              </entry>
> +              <entry>example: internal, external</entry>
> +              <entry>No</entry>
> +              <entry>A unique string identifying the slot name</entry>
> +            </row>
>            </tbody>
>          </tgroup>
>        </informaltable>
> diff --git a/hald/linux/device.c b/hald/linux/device.c
> index 26f6c1b..32e7cdd 100644
> --- a/hald/linux/device.c
> +++ b/hald/linux/device.c
> @@ -1526,6 +1526,8 @@ mmc_host_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *pare
>  	sscanf (last_elem, "mmc%d", &host_num);
>  	hal_device_property_set_int (d, "mmc_host.host", host_num);
>  
> +	hal_util_set_string_from_file (d, "mmc_host.slot_name", sysfs_path, "slot_name");
> +
>  out:
>  	return d;
>  }



More information about the hal mailing list