* [PATCH] ssb: move ssb_commit_settings and export it
@ 2011-05-05 22:45 Rafał Miłecki
2011-05-06 9:01 ` Michael Büsch
0 siblings, 1 reply; 3+ messages in thread
From: Rafał Miłecki @ 2011-05-05 22:45 UTC (permalink / raw)
To: linux-wireless, John W. Linville, Michael Büsch
Cc: b43-dev, Rafał Miłecki
Commiting settings is possible on devices without PCI core (but with CC
core). Export it for usage in other cores drivers.
Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
drivers/ssb/driver_pcicore.c | 26 --------------------------
drivers/ssb/main.c | 25 +++++++++++++++++++++++++
include/linux/ssb/ssb.h | 1 +
3 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
index 8fde122..82feb34 100644
--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -21,8 +21,6 @@ static u16 ssb_pcie_mdio_read(struct ssb_pcicore *pc, u8 device, u8 address);
static void ssb_pcie_mdio_write(struct ssb_pcicore *pc, u8 device,
u8 address, u16 data);
-static void ssb_commit_settings(struct ssb_bus *bus);
-
static inline
u32 pcicore_read32(struct ssb_pcicore *pc, u16 offset)
{
@@ -659,30 +657,6 @@ static void ssb_pcie_mdio_write(struct ssb_pcicore *pc, u8 device,
pcicore_write32(pc, mdio_control, 0);
}
-static void ssb_broadcast_value(struct ssb_device *dev,
- u32 address, u32 data)
-{
- /* This is used for both, PCI and ChipCommon core, so be careful. */
- BUILD_BUG_ON(SSB_PCICORE_BCAST_ADDR != SSB_CHIPCO_BCAST_ADDR);
- BUILD_BUG_ON(SSB_PCICORE_BCAST_DATA != SSB_CHIPCO_BCAST_DATA);
-
- ssb_write32(dev, SSB_PCICORE_BCAST_ADDR, address);
- ssb_read32(dev, SSB_PCICORE_BCAST_ADDR); /* flush */
- ssb_write32(dev, SSB_PCICORE_BCAST_DATA, data);
- ssb_read32(dev, SSB_PCICORE_BCAST_DATA); /* flush */
-}
-
-static void ssb_commit_settings(struct ssb_bus *bus)
-{
- struct ssb_device *dev;
-
- dev = bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev;
- if (WARN_ON(!dev))
- return;
- /* This forces an update of the cached registers. */
- ssb_broadcast_value(dev, 0xFD8, 0);
-}
-
int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
struct ssb_device *dev)
{
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index ad3da93..ee2937c 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -1329,6 +1329,31 @@ error:
}
EXPORT_SYMBOL(ssb_bus_powerup);
+static void ssb_broadcast_value(struct ssb_device *dev,
+ u32 address, u32 data)
+{
+ /* This is used for both, PCI and ChipCommon core, so be careful. */
+ BUILD_BUG_ON(SSB_PCICORE_BCAST_ADDR != SSB_CHIPCO_BCAST_ADDR);
+ BUILD_BUG_ON(SSB_PCICORE_BCAST_DATA != SSB_CHIPCO_BCAST_DATA);
+
+ ssb_write32(dev, SSB_PCICORE_BCAST_ADDR, address);
+ ssb_read32(dev, SSB_PCICORE_BCAST_ADDR); /* flush */
+ ssb_write32(dev, SSB_PCICORE_BCAST_DATA, data);
+ ssb_read32(dev, SSB_PCICORE_BCAST_DATA); /* flush */
+}
+
+void ssb_commit_settings(struct ssb_bus *bus)
+{
+ struct ssb_device *dev;
+
+ dev = bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev;
+ if (WARN_ON(!dev))
+ return;
+ /* This forces an update of the cached registers. */
+ ssb_broadcast_value(dev, 0xFD8, 0);
+}
+EXPORT_SYMBOL(ssb_commit_settings);
+
u32 ssb_admatch_base(u32 adm)
{
u32 base = 0;
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 7e99b34..f017b89 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -518,6 +518,7 @@ extern int ssb_bus_may_powerdown(struct ssb_bus *bus);
* Otherwise static always-on powercontrol will be used. */
extern int ssb_bus_powerup(struct ssb_bus *bus, bool dynamic_pctl);
+extern void ssb_commit_settings(struct ssb_bus *bus);
/* Various helper functions */
extern u32 ssb_admatch_base(u32 adm);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] ssb: move ssb_commit_settings and export it
2011-05-05 22:45 [PATCH] ssb: move ssb_commit_settings and export it Rafał Miłecki
@ 2011-05-06 9:01 ` Michael Büsch
2011-05-06 9:05 ` Rafał Miłecki
0 siblings, 1 reply; 3+ messages in thread
From: Michael Büsch @ 2011-05-06 9:01 UTC (permalink / raw)
To: Rafał Miłecki
Cc: linux-wireless, John W. Linville, Michael Büsch, b43-dev
On Fri, 2011-05-06 at 00:45 +0200, Rafa? Mi?ecki wrote:
> +EXPORT_SYMBOL(ssb_commit_settings);
Don't add EXPORT_SYMBOLs, unless you also add an actual
user within the same patch series.
--
Greetings Michael.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] ssb: move ssb_commit_settings and export it
2011-05-06 9:01 ` Michael Büsch
@ 2011-05-06 9:05 ` Rafał Miłecki
0 siblings, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2011-05-06 9:05 UTC (permalink / raw)
To: Michael Büsch
Cc: linux-wireless, John W. Linville, Michael Büsch, b43-dev
2011/5/6 Michael B?sch <m@bues.ch>:
> On Fri, 2011-05-06 at 00:45 +0200, Rafa? Mi?ecki wrote:
>> +EXPORT_SYMBOL(ssb_commit_settings);
>
> Don't add EXPORT_SYMBOLs, unless you also add an actual
> user within the same patch series.
OK, John please drop this. I'll resubmit this in series with b43 patch
when it's ready.
--
Rafa?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-06 9:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-05 22:45 [PATCH] ssb: move ssb_commit_settings and export it Rafał Miłecki
2011-05-06 9:01 ` Michael Büsch
2011-05-06 9:05 ` Rafał Miłecki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).