summaryrefslogtreecommitdiff
path: root/drivers/net/ieee802154/atusb.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-09-05 12:27:59 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-09-17 13:20:06 +0200
commit9def9afde77a298bfc6ad84a6c5a9e9523aa8bab (patch)
treefb1393154720110d59ae75c6051f2f52df2c0cae /drivers/net/ieee802154/atusb.c
parentc5080d42db1d5d5c57274bb4235d0e50fd3a3a6d (diff)
downloadlwn-9def9afde77a298bfc6ad84a6c5a9e9523aa8bab.tar.gz
lwn-9def9afde77a298bfc6ad84a6c5a9e9523aa8bab.zip
atusb: add handling for different chipnames
This patch supports handling for printout different chipnames between atusb and rzusb. The rzusb contains an at86rf230 and atusb an at86rf231 transceiver. Cc: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net/ieee802154/atusb.c')
-rw-r--r--drivers/net/ieee802154/atusb.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 80dfc725b8dc..199a94a9c8bc 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -559,6 +559,7 @@ static int atusb_get_and_show_chip(struct atusb *atusb)
{
struct usb_device *usb_dev = atusb->usb_dev;
uint8_t man_id_0, man_id_1, part_num, version_num;
+ const char *chip;
man_id_0 = atusb_read_reg(atusb, RG_MAN_ID_0);
man_id_1 = atusb_read_reg(atusb, RG_MAN_ID_1);
@@ -574,14 +575,22 @@ static int atusb_get_and_show_chip(struct atusb *atusb)
man_id_1, man_id_0);
goto fail;
}
- if (part_num != 3 && part_num != 2) {
+
+ switch (part_num) {
+ case 2:
+ chip = "AT86RF230";
+ break;
+ case 3:
+ chip = "AT86RF231";
+ break;
+ default:
dev_err(&usb_dev->dev,
"unexpected transceiver, part 0x%02x version 0x%02x\n",
part_num, version_num);
goto fail;
}
- dev_info(&usb_dev->dev, "ATUSB: AT86RF231 version %d\n", version_num);
+ dev_info(&usb_dev->dev, "ATUSB: %s version %d\n", chip, version_num);
return 0;