ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 2 Jan 2023 11:41:48 +0000 (12:41 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 16 Jan 2023 11:16:38 +0000 (11:16 +0000)
commit738455858a2d21b769f673892546cf8300c9fd78
treec847716888b0b922141d413ce81de47637b7b836
parent31a90367443b21f76b972c00aad3430447c999d6
ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity

The shutdown GPIO is active low (SD_N), but this depends on actual board
layout.  Linux drivers should only care about logical state, where high
(1) means shutdown and low (0) means do not shutdown.

Invert the GPIO to match logical value while preserving backwards DTB
compatibility.  It is not possible to detect whether ACTIVE_HIGH flag in
DTB is because it is an old DTB (using incorrect flag) or it is a new
DTB with a correct hardware pin polarity description.  Therefore the
solution prioritizes backwards compatibility while relying on relevant
DTS being upstreamed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wsa881x.c