summaryrefslogtreecommitdiff
path: root/sound/soc/uniphier/aio-core.c
diff options
context:
space:
mode:
authorKatsuhiro Suzuki <suzuki.katsuhiro@socionext.com>2018-03-16 16:08:13 +0900
committerMark Brown <broonie@kernel.org>2018-03-18 17:57:54 -0700
commit7c3c20f2bec1e8bdaadd551a4b75f1834a7cb974 (patch)
tree020714b15ea8c8d115f43396bacc7b5edf33d676 /sound/soc/uniphier/aio-core.c
parent8bde8fd64d1b8f8bc1577e28ff412553597b6adb (diff)
ASoC: uniphier: add syscon property for UniPhier sound system
This patch adds syscon property for specifying soc-glue core. Currently, soc-glue core is used for changing the state of S/PDIF signal output pin to signal output state or Hi-Z state. After resetting of SoC Hi-Z state is selected. This driver set to signal output state when syscon property is available. Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/uniphier/aio-core.c')
-rw-r--r--sound/soc/uniphier/aio-core.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/soc/uniphier/aio-core.c b/sound/soc/uniphier/aio-core.c
index 1711361fc0c2..6d50042a4571 100644
--- a/sound/soc/uniphier/aio-core.c
+++ b/sound/soc/uniphier/aio-core.c
@@ -84,6 +84,27 @@ u64 aio_rb_space_to_end(struct uniphier_aio_sub *sub)
}
/**
+ * aio_iecout_set_enable - setup IEC output via SoC glue
+ * @chip: the AIO chip pointer
+ * @enable: false to stop the output, true to start
+ *
+ * Set enabled or disabled S/PDIF signal output to out of SoC via AOnIEC pins.
+ * This function need to call at driver startup.
+ *
+ * The regmap of SoC glue is specified by 'socionext,syscon' optional property
+ * of DT. This function has no effect if no property.
+ */
+void aio_iecout_set_enable(struct uniphier_aio_chip *chip, bool enable)
+{
+ struct regmap *r = chip->regmap_sg;
+
+ if (!r)
+ return;
+
+ regmap_write(r, SG_AOUTEN, (enable) ? ~0 : 0);
+}
+
+/**
* aio_chip_set_pll - set frequency to audio PLL
* @chip : the AIO chip pointer
* @source: PLL