ASoC: davinci-mcasp: Logic low for inactive output slots
authorMisael Lopez Cruz <misael.lopez@ti.com>
Mon, 8 Jun 2015 13:03:47 +0000 (16:03 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 8 Jun 2015 17:51:26 +0000 (18:51 +0100)
The default state when serializers are in inactive slots is Hi-Z.
In some cases, there are no additional components driving the data
lines to a safe state so they might have noise.

While in inactive slots, the McASP AXR pins configured as outputs
can be driven low through the serializer pin drive mode setting
(DISMOD) to prevent such noise.

Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/davinci/davinci-mcasp.c
sound/soc/davinci/davinci-mcasp.h

index 56da8ce1faf36c6b6c463137ad8b53caeee9f8f6..68356f2c78f8e091e3d9c30ddfd0f2becc1c1667 100644 (file)
@@ -686,6 +686,8 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
                if (mcasp->serial_dir[i] == TX_MODE &&
                                        tx_ser < max_active_serializers) {
                        mcasp_set_bits(mcasp, DAVINCI_MCASP_PDIR_REG, AXR(i));
+                       mcasp_mod_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
+                                      DISMOD_LOW, DISMOD_MASK);
                        tx_ser++;
                } else if (mcasp->serial_dir[i] == RX_MODE &&
                                        rx_ser < max_active_serializers) {
index 79dc511180bfdcb22649ce791beead7c2a1691d4..a3be108a8c1775eae827459fbb4133edeefebd8a 100644 (file)
  * DAVINCI_MCASP_XRSRCTL_BASE_REG -  Serializer Control Register Bits
  */
 #define MODE(val)      (val)
-#define DISMOD         (val)(val<<2)
+#define DISMOD_3STATE  (0x0)
+#define DISMOD_LOW     (0x2 << 2)
+#define DISMOD_HIGH    (0x3 << 2)
+#define DISMOD_MASK    DISMOD_HIGH
 #define TXSTATE                BIT(4)
 #define RXSTATE                BIT(5)
 #define SRMOD_MASK     3