]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: ipack: Obtain supported speeds from ID ROM.
authorJens Taprogge <jens.taprogge@taprogge.org>
Tue, 11 Sep 2012 11:34:57 +0000 (13:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Sep 2012 19:16:35 +0000 (12:16 -0700)
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ipack/ipack.c
drivers/staging/ipack/ipack.h

index af47772da5158b76dc6ff4f252c907611b76c365..c36ba9ee7ef100c5b249469bdfc000c2bf80e9fb 100644 (file)
@@ -262,15 +262,21 @@ static void ipack_parse_id1(struct ipack_device *dev)
 
        dev->id_vendor = id[4];
        dev->id_device = id[5];
+       dev->speed_8mhz = 1;
+       dev->speed_32mhz = (id[7] == 'H');
 }
 
 static void ipack_parse_id2(struct ipack_device *dev)
 {
        __be16 *id = (__be16 *) dev->id;
+       u16 flags;
 
        dev->id_vendor = ((be16_to_cpu(id[3]) & 0xff) << 16)
                         + be16_to_cpu(id[4]);
        dev->id_device = be16_to_cpu(id[5]);
+       flags = be16_to_cpu(id[10]);
+       dev->speed_8mhz = !!(flags & 2);
+       dev->speed_32mhz = !!(flags & 4);
 }
 
 static int ipack_device_read_id(struct ipack_device *dev)
index a1333042338960886c7449a065d3c05246238664..89af9e4ee0dc6a56eaed8285cae14bcfedc026ca 100644 (file)
@@ -79,6 +79,8 @@ struct ipack_device {
        u32                      id_vendor;
        u32                      id_device;
        u8                       id_format;
+       unsigned int             speed_8mhz:1;
+       unsigned int             speed_32mhz:1;
 };
 
 /**