All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] bcma: support alternative (BCM4706) ChipCommon core id
@ 2012-07-09 20:14 Rafał Miłecki
  2012-07-09 21:35 ` Hauke Mehrtens
  0 siblings, 1 reply; 3+ messages in thread
From: Rafał Miłecki @ 2012-07-09 20:14 UTC (permalink / raw)
  To: linux-wireless; +Cc: Hauke Mehrtens, Rafał Miłecki

---
 drivers/bcma/main.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 173a0b4..61ac6cf 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -61,6 +61,13 @@ static struct bus_type bcma_bus_type = {
 	.dev_attrs	= bcma_device_attrs,
 };
 
+static u16 bcma_cc_core_id(struct bcma_bus *bus)
+{
+	if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
+		return BCMA_CORE_4706_CHIPCOMMON;
+	return BCMA_CORE_CHIPCOMMON;
+}
+
 struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid)
 {
 	struct bcma_device *core;
@@ -91,6 +98,7 @@ static int bcma_register_cores(struct bcma_bus *bus)
 	list_for_each_entry(core, &bus->cores, list) {
 		/* We support that cores ourself */
 		switch (core->id.id) {
+		case BCMA_CORE_4706_CHIPCOMMON:
 		case BCMA_CORE_CHIPCOMMON:
 		case BCMA_CORE_PCI:
 		case BCMA_CORE_PCIE:
@@ -157,7 +165,7 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
 	}
 
 	/* Init CC core */
-	core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON);
+	core = bcma_find_core(bus, bcma_cc_core_id(bus));
 	if (core) {
 		bus->drv_cc.core = core;
 		bcma_core_chipcommon_init(&bus->drv_cc);
@@ -215,7 +223,7 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
 	bcma_init_bus(bus);
 
 	match.manuf = BCMA_MANUF_BCM;
-	match.id = BCMA_CORE_CHIPCOMMON;
+	match.id = bcma_cc_core_id(bus);
 	match.class = BCMA_CL_SIM;
 	match.rev = BCMA_ANY_REV;
 
@@ -239,7 +247,7 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
 	}
 
 	/* Init CC core */
-	core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON);
+	core = bcma_find_core(bus, bcma_cc_core_id(bus));
 	if (core) {
 		bus->drv_cc.core = core;
 		bcma_core_chipcommon_init(&bus->drv_cc);
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC][PATCH] bcma: support alternative (BCM4706) ChipCommon core id
  2012-07-09 20:14 [RFC][PATCH] bcma: support alternative (BCM4706) ChipCommon core id Rafał Miłecki
@ 2012-07-09 21:35 ` Hauke Mehrtens
  2012-07-10  5:05   ` Rafał Miłecki
  0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2012-07-09 21:35 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linux-wireless

Hi Rafał,

Could you add some info why you haven't replaced all places where
BCMA_CORE_CHIPCOMMON was used with this functions in the commit message.

By the way, why is bcma_find_core() beeing called in bcma_bus_resume()?
The code should better check for bus->drv_cc.core and not for core.

On 07/09/2012 10:14 PM, Rafał Miłecki wrote:
> ---
>  drivers/bcma/main.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> index 173a0b4..61ac6cf 100644
> --- a/drivers/bcma/main.c
> +++ b/drivers/bcma/main.c
> @@ -61,6 +61,13 @@ static struct bus_type bcma_bus_type = {
>  	.dev_attrs	= bcma_device_attrs,
>  };
>  
> +static u16 bcma_cc_core_id(struct bcma_bus *bus)
> +{
> +	if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
> +		return BCMA_CORE_4706_CHIPCOMMON;
> +	return BCMA_CORE_CHIPCOMMON;
> +}
> +
>  struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid)
>  {
>  	struct bcma_device *core;
> @@ -91,6 +98,7 @@ static int bcma_register_cores(struct bcma_bus *bus)
>  	list_for_each_entry(core, &bus->cores, list) {
>  		/* We support that cores ourself */
>  		switch (core->id.id) {
> +		case BCMA_CORE_4706_CHIPCOMMON:
>  		case BCMA_CORE_CHIPCOMMON:
>  		case BCMA_CORE_PCI:
>  		case BCMA_CORE_PCIE:
> @@ -157,7 +165,7 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
>  	}
>  
>  	/* Init CC core */
> -	core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON);
> +	core = bcma_find_core(bus, bcma_cc_core_id(bus));
>  	if (core) {
>  		bus->drv_cc.core = core;
>  		bcma_core_chipcommon_init(&bus->drv_cc);
> @@ -215,7 +223,7 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
>  	bcma_init_bus(bus);
>  
>  	match.manuf = BCMA_MANUF_BCM;
> -	match.id = BCMA_CORE_CHIPCOMMON;
> +	match.id = bcma_cc_core_id(bus);
>  	match.class = BCMA_CL_SIM;
>  	match.rev = BCMA_ANY_REV;
>  
> @@ -239,7 +247,7 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
>  	}
>  
>  	/* Init CC core */
> -	core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON);
> +	core = bcma_find_core(bus, bcma_cc_core_id(bus));
>  	if (core) {
>  		bus->drv_cc.core = core;
>  		bcma_core_chipcommon_init(&bus->drv_cc);
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC][PATCH] bcma: support alternative (BCM4706) ChipCommon core id
  2012-07-09 21:35 ` Hauke Mehrtens
@ 2012-07-10  5:05   ` Rafał Miłecki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2012-07-10  5:05 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linux-wireless

2012/7/9 Hauke Mehrtens <hauke@hauke-m.de>:
> Hi Rafał,
>
> Could you add some info why you haven't replaced all places where
> BCMA_CORE_CHIPCOMMON was used with this functions in the commit message.

I see you mean "bcma_bus_resume". I should have replaced it anyway, to
avoid confusion.


> By the way, why is bcma_find_core() beeing called in bcma_bus_resume()?
> The code should better check for bus->drv_cc.core and not for core.

Sounds sane.

-- 
Rafał

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-10  5:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-09 20:14 [RFC][PATCH] bcma: support alternative (BCM4706) ChipCommon core id Rafał Miłecki
2012-07-09 21:35 ` Hauke Mehrtens
2012-07-10  5:05   ` Rafał Miłecki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.