Commit 0b0f3a1b authored by Jens Taprogge's avatar Jens Taprogge Committed by Greg Kroah-Hartman

Staging: ipack: Obtain supported speeds from ID ROM.

Signed-off-by: default avatarJens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: default avatarSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eb12d88b
...@@ -262,15 +262,21 @@ static void ipack_parse_id1(struct ipack_device *dev) ...@@ -262,15 +262,21 @@ static void ipack_parse_id1(struct ipack_device *dev)
dev->id_vendor = id[4]; dev->id_vendor = id[4];
dev->id_device = id[5]; dev->id_device = id[5];
dev->speed_8mhz = 1;
dev->speed_32mhz = (id[7] == 'H');
} }
static void ipack_parse_id2(struct ipack_device *dev) static void ipack_parse_id2(struct ipack_device *dev)
{ {
__be16 *id = (__be16 *) dev->id; __be16 *id = (__be16 *) dev->id;
u16 flags;
dev->id_vendor = ((be16_to_cpu(id[3]) & 0xff) << 16) dev->id_vendor = ((be16_to_cpu(id[3]) & 0xff) << 16)
+ be16_to_cpu(id[4]); + be16_to_cpu(id[4]);
dev->id_device = be16_to_cpu(id[5]); 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) static int ipack_device_read_id(struct ipack_device *dev)
......
...@@ -79,6 +79,8 @@ struct ipack_device { ...@@ -79,6 +79,8 @@ struct ipack_device {
u32 id_vendor; u32 id_vendor;
u32 id_device; u32 id_device;
u8 id_format; u8 id_format;
unsigned int speed_8mhz:1;
unsigned int speed_32mhz:1;
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment