linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: powermac: don't workaround for keywest
@ 2015-05-09 17:23 Wolfram Sang
  2015-05-10 18:34 ` Wolfram Sang
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2015-05-09 17:23 UTC (permalink / raw)
  To: linux-i2c, Benjamin Herrenschmidt
  Cc: Mark Elliott, linuxppc-dev, Dan DeVoto, Wolfram Sang

Commit 3a3dd0186f619b ("i2c/powermac: Improve detection of devices from
device-tree") added a codec device instantiation workaround
unconditionally although it is only needed for onyx. Do it conditionally
since keywest has its own codec instantiation in the sound drivers.
Thanks must go to GrowlTiger from Gentoo bug report #469132 for
bisecting.

Reported-by: Dan DeVoto <dand1972@yahoo.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Tested-by: Dan DeVoto <dand1972@yahoo.com>
Tested-by: Mark Elliott <txlitebeer@gmail.com>
Fixes: 3a3dd0186f619b ("i2c/powermac: Improve detection of devices from device-tree")
---
 drivers/i2c/busses/i2c-powermac.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index 6abcf696e3594b..cad5552c0cd4e4 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -285,7 +285,8 @@ static void i2c_powermac_add_missing(struct i2c_adapter *adap,
 
 static bool i2c_powermac_get_type(struct i2c_adapter *adap,
 					    struct device_node *node,
-					    u32 addr, char *type, int type_size)
+					    u32 addr, char *type, int type_size,
+					    bool found_onyx)
 {
 	char tmp[16];
 
@@ -305,8 +306,8 @@ static bool i2c_powermac_get_type(struct i2c_adapter *adap,
 		return true;
 	}
 
-	/* Now look for known workarounds */
-	if (!strcmp(node->name, "deq")) {
+	/* Now look for known workarounds for onyx/aoa */
+	if (found_onyx && !strcmp(node->name, "deq")) {
 		/* Apple uses address 0x34 for TAS3001 and 0x35 for TAS3004 */
 		if (addr == 0x34) {
 			snprintf(type, type_size, "MAC,tas3001");
@@ -362,7 +363,7 @@ static void i2c_powermac_register_devices(struct i2c_adapter *adap,
 
 		/* Make up a modalias */
 		if (!i2c_powermac_get_type(adap, node, addr,
-					   info.type, sizeof(info.type))) {
+					   info.type, sizeof(info.type), found_onyx)) {
 			continue;
 		}
 
-- 
2.1.4

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

end of thread, other threads:[~2015-05-17  8:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-09 17:23 [PATCH] i2c: powermac: don't workaround for keywest Wolfram Sang
2015-05-10 18:34 ` Wolfram Sang
2015-05-10 22:14   ` Benjamin Herrenschmidt
2015-05-11  7:34     ` wsa
2015-05-11 23:26       ` Benjamin Herrenschmidt
2015-05-17  8:40         ` Dan DeVoto

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).