Subject: Re: [PATCH] i2c: powermac: don't workaround for keywest

From: Wolfram Sang <[email-masked]>
Date: Sun, 10 May 2015 20:34:32 +0200

On Sat, May 09, 2015 at 07:23:33PM +0200, Wolfram Sang wrote:
> 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 <[email-masked]>
> Signed-off-by: Wolfram Sang <[email-masked]>
> Tested-by: Dan DeVoto <[email-masked]>
> Tested-by: Mark Elliott <[email-masked]>
> 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 */

Okay, so this patch is bogus. I understand now that onyx uses another
codec than TAS, so this change will regress on other machines. However,
it shows that this unconditional instantiation of the TAS breaks sound
on Macintoshs which still need non-aoa sound support. I assume there
will be noone in the near future to convert Keywest to AOA, so we'll
need to find a hackish way around this instantiation problem.