[PATCH] add mmc_host slot_name support

Guillem Jover guillem.jover at nokia.com
Mon Oct 13 13:18:40 PDT 2008


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.
---
 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;
 }
-- 
1.5.6.5


More information about the hal mailing list