summaryrefslogtreecommitdiffstats
path: root/drivers/bcma/sprom.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-06-29 19:44:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-09 16:36:03 -0400
commit4b4f5be2e49a604de11dee0ee9b3f151de061724 (patch)
tree147dda1b47876ba586049dbea6f5e8eaae5dd069 /drivers/bcma/sprom.c
parent00eeedcf084a21bf436ff3147f11f0923c811155 (diff)
bcma: add constants for chip ids
The chip IDs are used all over bcma and no constants where defined. This patch adds the constants and makes bcma use them. Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/sprom.c')
-rw-r--r--drivers/bcma/sprom.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c
index f16f42d36071..e1eb598ec702 100644
--- a/drivers/bcma/sprom.c
+++ b/drivers/bcma/sprom.c
@@ -468,11 +468,11 @@ static bool bcma_sprom_ext_available(struct bcma_bus *bus)
468 /* older chipcommon revisions use chip status register */ 468 /* older chipcommon revisions use chip status register */
469 chip_status = bcma_read32(bus->drv_cc.core, BCMA_CC_CHIPSTAT); 469 chip_status = bcma_read32(bus->drv_cc.core, BCMA_CC_CHIPSTAT);
470 switch (bus->chipinfo.id) { 470 switch (bus->chipinfo.id) {
471 case 0x4313: 471 case BCMA_CHIP_ID_BCM4313:
472 present_mask = BCMA_CC_CHIPST_4313_SPROM_PRESENT; 472 present_mask = BCMA_CC_CHIPST_4313_SPROM_PRESENT;
473 break; 473 break;
474 474
475 case 0x4331: 475 case BCMA_CHIP_ID_BCM4331:
476 present_mask = BCMA_CC_CHIPST_4331_SPROM_PRESENT; 476 present_mask = BCMA_CC_CHIPST_4331_SPROM_PRESENT;
477 break; 477 break;
478 478
@@ -494,16 +494,16 @@ static bool bcma_sprom_onchip_available(struct bcma_bus *bus)
494 494
495 chip_status = bcma_read32(bus->drv_cc.core, BCMA_CC_CHIPSTAT); 495 chip_status = bcma_read32(bus->drv_cc.core, BCMA_CC_CHIPSTAT);
496 switch (bus->chipinfo.id) { 496 switch (bus->chipinfo.id) {
497 case 0x4313: 497 case BCMA_CHIP_ID_BCM4313:
498 present = chip_status & BCMA_CC_CHIPST_4313_OTP_PRESENT; 498 present = chip_status & BCMA_CC_CHIPST_4313_OTP_PRESENT;
499 break; 499 break;
500 500
501 case 0x4331: 501 case BCMA_CHIP_ID_BCM4331:
502 present = chip_status & BCMA_CC_CHIPST_4331_OTP_PRESENT; 502 present = chip_status & BCMA_CC_CHIPST_4331_OTP_PRESENT;
503 break; 503 break;
504 504
505 case 43224: 505 case BCMA_CHIP_ID_BCM43224:
506 case 43225: 506 case BCMA_CHIP_ID_BCM43225:
507 /* for these chips OTP is always available */ 507 /* for these chips OTP is always available */
508 present = true; 508 present = true;
509 break; 509 break;
@@ -579,13 +579,15 @@ int bcma_sprom_get(struct bcma_bus *bus)
579 if (!sprom) 579 if (!sprom)
580 return -ENOMEM; 580 return -ENOMEM;
581 581
582 if (bus->chipinfo.id == 0x4331 || bus->chipinfo.id == 43431) 582 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4331 ||
583 bus->chipinfo.id == BCMA_CHIP_ID_BCM43431)
583 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, false); 584 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, false);
584 585
585 pr_debug("SPROM offset 0x%x\n", offset); 586 pr_debug("SPROM offset 0x%x\n", offset);
586 bcma_sprom_read(bus, offset, sprom); 587 bcma_sprom_read(bus, offset, sprom);
587 588
588 if (bus->chipinfo.id == 0x4331 || bus->chipinfo.id == 43431) 589 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4331 ||
590 bus->chipinfo.id == BCMA_CHIP_ID_BCM43431)
589 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true); 591 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true);
590 592
591 err = bcma_sprom_valid(sprom); 593 err = bcma_sprom_valid(sprom);