Commit a7be8461 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: interface: add Ara serial-number support

Add support for reading the Ara serial-number attributes.
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 50ad4163
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#define DME_TOSHIBA_ARA_VID 0x6000 #define DME_TOSHIBA_ARA_VID 0x6000
#define DME_TOSHIBA_ARA_PID 0x6001 #define DME_TOSHIBA_ARA_PID 0x6001
#define DME_TOSHIBA_ARA_SN0 0x6002
#define DME_TOSHIBA_ARA_SN1 0x6003
#define DME_TOSHIBA_ARA_INIT_STATUS 0x6101 #define DME_TOSHIBA_ARA_INIT_STATUS 0x6101
/* DDBL1 Manufacturer and Product ids */ /* DDBL1 Manufacturer and Product ids */
...@@ -42,6 +44,7 @@ static int gb_interface_dme_attr_get(struct gb_interface *intf, ...@@ -42,6 +44,7 @@ static int gb_interface_dme_attr_get(struct gb_interface *intf,
static int gb_interface_read_ara_dme(struct gb_interface *intf) static int gb_interface_read_ara_dme(struct gb_interface *intf)
{ {
u32 sn0, sn1;
int ret; int ret;
/* /*
...@@ -64,8 +67,15 @@ static int gb_interface_read_ara_dme(struct gb_interface *intf) ...@@ -64,8 +67,15 @@ static int gb_interface_read_ara_dme(struct gb_interface *intf)
if (ret) if (ret)
return ret; return ret;
/* FIXME: serial number not implemented */ ret = gb_interface_dme_attr_get(intf, DME_TOSHIBA_ARA_SN0, &sn0);
intf->serial_number = 0; if (ret)
return ret;
ret = gb_interface_dme_attr_get(intf, DME_TOSHIBA_ARA_SN1, &sn1);
if (ret)
return ret;
intf->serial_number = (u64)sn1 << 32 | sn0;
return 0; return 0;
} }
......
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