diff options
author | Jens Taprogge <jens.taprogge@taprogge.org> | 2012-09-11 11:34:57 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-11 19:16:35 (GMT) |
commit | 0b0f3a1bee7f321b92ffc37d8b32d1ce412a285c (patch) | |
tree | 95d14c83eb8c319604d2169ee22df5f153518844 /drivers/staging/ipack | |
parent | eb12d88bf5f07a5aac77bebdfcb8a77ade48964e (diff) | |
download | linux-0b0f3a1bee7f321b92ffc37d8b32d1ce412a285c.tar.xz |
Staging: ipack: Obtain supported speeds from ID ROM.
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>
Diffstat (limited to 'drivers/staging/ipack')
-rw-r--r-- | drivers/staging/ipack/ipack.c | 6 | ||||
-rw-r--r-- | drivers/staging/ipack/ipack.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/ipack/ipack.c b/drivers/staging/ipack/ipack.c index af47772..c36ba9e 100644 --- a/drivers/staging/ipack/ipack.c +++ b/drivers/staging/ipack/ipack.c @@ -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) diff --git a/drivers/staging/ipack/ipack.h b/drivers/staging/ipack/ipack.h index a133304..89af9e4 100644 --- a/drivers/staging/ipack/ipack.h +++ b/drivers/staging/ipack/ipack.h @@ -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; }; /** |