summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f7bb92)
raw | patch | inline | side by side (parent: 9f7bb92)
author | Tracy Yi <tracy-yi@ti.com> | |
Sun, 4 Feb 2018 09:18:43 +0000 (17:18 +0800) | ||
committer | Tracy Yi <tracy-yi@ti.com> | |
Sun, 4 Feb 2018 09:18:43 +0000 (17:18 +0800) |
Signed-off-by: Tracy Yi <tracy-yi@ti.com>
dai_link.readme | patch | blob | history | |
tas2770-codec.c | patch | blob | history | |
tas2770-codec.h | patch | blob | history | |
tas2770-regmap.c | patch | blob | history | |
tas2770.h | patch | blob | history |
diff --git a/dai_link.readme b/dai_link.readme
index 5381295b310e593b7cdd978732d6c98170c1a0f6..17108114abca50e501c97ce1e341da6fc5cce30c 100644 (file)
--- a/dai_link.readme
+++ b/dai_link.readme
-example for connecting CPU DAI\r
-\r
-#if defined(CONFIG_TAS2770_CODEC) \r
- {\r
- .name = LPASS_BE_PRI_MI2S_RX,\r
- .stream_name = "Primary MI2S Hostless Playback",\r
- .cpu_dai_name = "msm-dai-q6-mi2s.0",\r
- .platform_name = "msm-pcm-routing",\r
- .codec_name = "tas2770.3-0041",\r
- .codec_dai_name = "tas2770 ASI",\r
- .no_pcm = 1,\r
- .be_id = MSM_BACKEND_DAI_PRI_MI2S_RX,\r
- .be_hw_params_fixup = msm_be_prim_mi2s_hw_params_fixup,\r
- .ops = &msm8974_prim_mi2s_be_ops,\r
- },\r
- {\r
- .name = LPASS_BE_PRI_MI2S_TX,\r
- .stream_name = "Primary MI2S Hostless Capture",\r
- .cpu_dai_name = "msm-dai-q6-mi2s.0",\r
- .platform_name = "msm-pcm-routing",\r
- .codec_name = "tas2770.3-0041",\r
- .codec_dai_name = "tas2770 ASI",\r
- .no_pcm = 1,\r
- .be_id = MSM_BACKEND_DAI_PRI_MI2S_TX,\r
- .be_hw_params_fixup = msm_be_prim_mi2s_hw_params_fixup,\r
- .ops = &msm8974_prim_mi2s_be_ops,\r
- },\r
-#endif
\ No newline at end of file
+example for connecting CPU DAI
+
+#if defined(CONFIG_TAS2770_CODEC)
+ {
+ .name = LPASS_BE_PRI_MI2S_RX,
+ .stream_name = "Primary MI2S Hostless Playback",
+ .cpu_dai_name = "msm-dai-q6-mi2s.0",
+ .platform_name = "msm-pcm-routing",
+ .codec_name = "tas2770.3-0041",
+ .codec_dai_name = "tas2770 ASI",
+ .no_pcm = 1,
+ .be_id = MSM_BACKEND_DAI_PRI_MI2S_RX,
+ .be_hw_params_fixup = msm_be_prim_mi2s_hw_params_fixup,
+ .ops = &msm8974_prim_mi2s_be_ops,
+ },
+ {
+ .name = LPASS_BE_PRI_MI2S_TX,
+ .stream_name = "Primary MI2S Hostless Capture",
+ .cpu_dai_name = "msm-dai-q6-mi2s.0",
+ .platform_name = "msm-pcm-routing",
+ .codec_name = "tas2770.3-0041",
+ .codec_dai_name = "tas2770 ASI",
+ .no_pcm = 1,
+ .be_id = MSM_BACKEND_DAI_PRI_MI2S_TX,
+ .be_hw_params_fixup = msm_be_prim_mi2s_hw_params_fixup,
+ .ops = &msm8974_prim_mi2s_be_ops,
+ },
+#endif
diff --git a/tas2770-codec.c b/tas2770-codec.c
index bab7ab0ea93d0abe15329f56b113e589b465be1f..6efab7a14d7f67c411510bc1afe67c99fc57be96 100644 (file)
--- a/tas2770-codec.c
+++ b/tas2770-codec.c
** tas2770-codec.c
**
** Description:
-** ALSA SoC driver for Texas Instruments TAS2770 High Performance 4W Smart
-** Amplifier
+** ALSA SoC driver for TAS2770 20-W Digital Input Mono Class-D Audio Amplifier
+** with Speaker I/V Sense
**
** =============================================================================
*/
diff --git a/tas2770-codec.h b/tas2770-codec.h
index 8fd4e0bf4aa597a4de9b89fe772f753ff2b19170..5cb70797f3bc13262c3fe4ac4040bf05105f3119 100644 (file)
--- a/tas2770-codec.h
+++ b/tas2770-codec.h
** FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
**
** File:
-** tas2560-codec.h
+** tas2770-codec.h
**
** Description:
** header file for tas2560-codec.c
int tas2770_deregister_codec(struct tas2770_priv *pTAS2770);
int tas2770_LoadConfig(struct tas2770_priv *pTAS2770, bool bPowerOn);
-#endif /* _TAS2560_CODEC_H */
+#endif /* _TAS2770_CODEC_H */
diff --git a/tas2770-regmap.c b/tas2770-regmap.c
index 7f9354e6f1f98c89f61f6d5d86c5569280774410..bee81288d6bb0564fca5f308b2a37a85835c23e2 100644 (file)
--- a/tas2770-regmap.c
+++ b/tas2770-regmap.c
/*
- * ALSA SoC Texas Instruments TAS2770 High Performance 4W Smart Amplifier
+ * ALSA SoC Texas Instruments TAS2770 20-W Digital Input Mono Class-D
+ * Audio Amplifier with Speaker I/V Sense
*
* Copyright (C) 2016 Texas Instruments, Inc.
*
diff --git a/tas2770.h b/tas2770.h
index fc3c1fc43cfe04bd3d0ab05d6229e24962c42eb8..197faec14e35842b313d5d428e529ab67e07bd93 100644 (file)
--- a/tas2770.h
+++ b/tas2770.h
#define TAS2770_REG(page, reg) ((page * 128) + reg)
- // Page
+ /* Page */
#define TAS2770_Page TAS2770_REG(0X0, 0x00)
#define TAS2770_Page_Page_Mask (0xff << 0)
- // Software Reset
+ /* Software Reset */
#define TAS2770_SoftwareReset TAS2770_REG(0X0, 0x01)
#define TAS2770_SoftwareReset_SoftwareReset_Mask (0x1 << 0),
#define TAS2770_SoftwareReset_SoftwareReset_DontReset (0x0 << 0)
#define TAS2770_SoftwareReset_SoftwareReset_Reset (0x1 << 0)
- // Power Control
+ /* Power Control */
#define TAS2770_PowerControl TAS2770_REG(0X0, 0x02)
#define TAS2770_PowerControl_ISNSPower_Mask (0x1 << 3)
#define TAS2770_PowerControl_ISNSPower_Active (0x0 << 3)
-#define TAS2770_PowerControl_ISNSPower_PoweredDown (0x1 << 3),
+#define TAS2770_PowerControl_ISNSPower_PoweredDown (0x1 << 3)
#define TAS2770_PowerControl_VSNSPower_Mask (0x1 << 2)
#define TAS2770_PowerControl_VSNSPower_Active (0x0 << 2)
#define TAS2770_PowerControl_VSNSPower_PoweredDown (0x1 << 2)
#define TAS2770_PowerControl_OperationalMode10_Mute (0x1 << 0)
#define TAS2770_PowerControl_OperationalMode10_Shutdown (0x2 << 0)
- //data format
+ /* data format */
#define TAS2770_DATAFORMAT_SHIFT 2
#define TAS2770_DATAFORMAT_I2S 0x0
#define TAS2770_DATAFORMAT_DSP 0x1
#define TAS2770_DATAFORMAT_RIGHT_J 0x2
#define TAS2770_DATAFORMAT_LEFT_J 0x3
-#define TAS2770_DAI_FMT_MASK (0x7 << TAS2770_DATAFORMAT_SHIFT)
+#define TAS2770_DAI_FMT_MASK (0x7 << TAS2770_DATAFORMAT_SHIFT)
- // Playback Configuration Reg0
+ /* Playback Configuration Reg0 */
#define TAS2770_PlaybackConfigurationReg0 TAS2770_REG(0X0, 0x03)
#define TAS2770_PlaybackConfigurationReg0_PDMPinMapping_Mask (0x1 << 7)
#define TAS2770_PlaybackConfigurationReg0_PDMPinMapping_Pdm0 (0x0 << 7)
#define TAS2770_PlaybackConfigurationReg0_PlaybackSource_Pdm (0x1 << 5)
#define TAS2770_PlaybackConfigurationReg0_AmplifierLevel40_Mask (0x1f << 0)
- // Playback Configuration Reg1
+ /* Playback Configuration Reg1 */
#define TAS2770_PlaybackConfigurationReg1 TAS2770_REG(0X0, 0x04)
#define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_Mask (0x7 << 0)
#define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_2 (0x1 << 0)
#define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_800 (0x6 << 0)
#define TAS2770_PlaybackConfigurationReg1_HPFFrequency20_Bypass (0x0 << 0)
- // Playback Configuration Reg2
+ /* Playback Configuration Reg2 */
#define TAS2770_PlaybackConfigurationReg2 TAS2770_REG(0X0, 0x05)
#define TAS2770_PlaybackConfigurationReg2_DVCPCM70_Mask (0xff << 0)
- // Playback Configuration Reg3
+ /* Playback Configuration Reg3 */
#define TAS2770_PlaybackConfigurationReg3 TAS2770_REG(0X0, 0x06)
#define TAS2770_PlaybackConfigurationReg3_DVCPDM70_Mask (0xff << 0)
- // Misc Configuration Reg0
+ /* Misc Configuration Reg0 */
#define TAS2770_MiscConfigurationReg0 TAS2770_REG(0X0, 0x07)
#define TAS2770_MiscConfigurationReg0_DVCRampRate76_Mask (0x3 << 6)
#define TAS2770_MiscConfigurationReg0_DVCRampRate76_0_5dbPer1Sample (0x0 << 6)
#define TAS2770_MiscConfigurationReg0_AMPSS_Disabled (0x0 << 2)
#define TAS2770_MiscConfigurationReg0_AMPSS_Enabled (0x1 << 2)
- // PDM Input Reg0
+ /* PDM Input Reg0 */
#define TAS2770_PDMInputReg0 TAS2770_REG(0X0, 0x08)
#define TAS2770_PDMInputReg0_ClassDSYNC_Mask (0x1 << 6)
#define TAS2770_PDMInputReg0_ClassDSYNC_AsyncMode (0x0 << 6)
#define TAS2770_PDMInputReg0_PDMRATED010_2_543_38MHz (0x0 << 0)
#define TAS2770_PDMInputReg0_PDMRATED010_5_086_76MHz (0x1 << 0)
- // PDM Configuration Reg1
+ /* PDM Configuration Reg1 */
#define TAS2770_PDMConfigurationReg1 TAS2770_REG(0X0, 0x09)
#define TAS2770_PDMConfigurationReg1_PDMEDGED1_Mask (0x1 << 7)
#define TAS2770_PDMConfigurationReg1_PDMEDGED1_Rising (0x0 << 7)
#define TAS2770_PDMConfigurationReg1_PDMGATED0_GatedOff (0x0 << 0)
#define TAS2770_PDMConfigurationReg1_PDMGATED0_Active (0x1 << 0)
- // TDM Configuration Reg0
+ /* TDM Configuration Reg0 */
#define TAS2770_TDMConfigurationReg0 TAS2770_REG(0X0, 0x0A)
#define TAS2770_TDMConfigurationReg0_SAMPRATERAMP_Mask (0x1 << 5)
#define TAS2770_TDMConfigurationReg0_SAMPRATERAMP_48KHz (0x0 << 5)
#define TAS2770_TDMConfigurationReg0_FRAMESTART_LowToHigh (0x0 << 0)
#define TAS2770_TDMConfigurationReg0_FRAMESTART_HighToLow (0x1 << 0)
- // TDM Configuration Reg1
+ /* TDM Configuration Reg1 */
#define TAS2770_TDMConfigurationReg1 TAS2770_REG(0X0, 0x0B)
#define TAS2770_TDMConfigurationReg1_RXJUSTIFY_Mask (0x1 << 6)
#define TAS2770_TDMConfigurationReg1_RXJUSTIFY_Left (0x0 << 6)
#define TAS2770_TDMConfigurationReg1_RXEDGE_Rising (0x0 << 0)
#define TAS2770_TDMConfigurationReg1_RXEDGE_Falling (0x1 << 0)
- // TDM Configuration Reg2
+ /* TDM Configuration Reg2 */
#define TAS2770_TDMConfigurationReg2 TAS2770_REG(0X0, 0x0C)
#define TAS2770_TDMConfigurationReg2_RXSCFG54_Mask (0x3 << 4)
#define TAS2770_TDMConfigurationReg2_RXSCFG54_Mono_I2C (0x0 << 4),
#define TAS2770_TDMConfigurationReg2_RXSLEN10_24Bits (0x1 << 0)
#define TAS2770_TDMConfigurationReg2_RXSLEN10_32Bits (0x2 << 0)
- // TDM Configuration Reg3
+ /* TDM Configuration Reg3 */
#define TAS2770_TDMConfigurationReg3 TAS2770_REG(0X0, 0x0D)
#define TAS2770_TDMConfigurationReg3_RXSLOTRight74_Mask (0xf << 4)
#define TAS2770_TDMConfigurationReg3_RXSLOTLeft30_Mask (0xf << 0)
- // TDM Configuration Reg4
+ /* TDM Configuration Reg4 */
#define TAS2770_TDMConfigurationReg4 TAS2770_REG(0X0, 0x0E)
#define TAS2770_TDMConfigurationReg4_TXKEEPER_Mask (0x1 << 5)
#define TAS2770_TDMConfigurationReg4_TXKEEPER_Disable (0x0 << 5)
#define TAS2770_TDMConfigurationReg4_TXEDGE_Rising (0x0 << 0)
#define TAS2770_TDMConfigurationReg4_TXEDGE_Falling (0x1 << 0)
- // TDM Configuration Reg5
+ /* TDM Configuration Reg5 */
#define TAS2770_TDMConfigurationReg5 TAS2770_REG(0X0, 0x0F)
#define TAS2770_TDMConfigurationReg5_VSNSTX_Mask (0x1 << 6)
-#define TAS2770_TDMConfigurationReg5_VSNSTX_Disable (0x0 << 6),
-#define TAS2770_TDMConfigurationReg5_VSNSTX_Enable (0x1 << 6),
+#define TAS2770_TDMConfigurationReg5_VSNSTX_Disable (0x0 << 6)
+#define TAS2770_TDMConfigurationReg5_VSNSTX_Enable (0x1 << 6)
#define TAS2770_TDMConfigurationReg5_VSNSSLOT50_Mask (0x3f << 0)
- // TDM Configuration Reg6
+ /* TDM Configuration Reg6 */
#define TAS2770_TDMConfigurationReg6 TAS2770_REG(0X0, 0x10)
#define TAS2770_TDMConfigurationReg6_ISNSTX_Mask (0x1 << 6)
-#define TAS2770_TDMConfigurationReg6_ISNSTX_Disable (0x0 << 6),
-#define TAS2770_TDMConfigurationReg6_ISNSTX_Enable (0x1 << 6),
+#define TAS2770_TDMConfigurationReg6_ISNSTX_Disable (0x0 << 6)
+#define TAS2770_TDMConfigurationReg6_ISNSTX_Enable (0x1 << 6)
#define TAS2770_TDMConfigurationReg6_ISNSSLOT50_Mask (0x3f << 0)
- // TDM Configuration Reg7
+ /* TDM Configuration Reg7 */
#define TAS2770_TDMConfigurationReg7 TAS2770_REG(0X0, 0x11)
#define TAS2770_TDMConfigurationReg7_PDMTX_Mask (0x1 << 6)
#define TAS2770_TDMConfigurationReg7_PDMTX_Disable (0x0 << 6)
#define TAS2770_TDMConfigurationReg7_PDMTX_Enable (0x1 << 6)
#define TAS2770_TDMConfigurationReg7_PDMSLOT50_Mask (0x3f << 0)
- // TDM Configuration Reg8
+ /* TDM Configuration Reg8 */
#define TAS2770_TDMConfigurationReg8 TAS2770_REG(0X0, 0x12)
#define TAS2770_TDMConfigurationReg8_VBATSLEN_Mask (0x1 << 7)
#define TAS2770_TDMConfigurationReg8_VBATSLEN_8Bits (0x0 << 7)
#define TAS2770_TDMConfigurationReg8_VBATTX_Enable (0x1 << 6)
#define TAS2770_TDMConfigurationReg8_VBATSLOT50_Mask (0x3f << 0)
- // TDM Configuration Reg9
+ /* TDM Configuration Reg9 */
#define TAS2770_TDMConfigurationReg9 TAS2770_REG(0X0, 0x13)
#define TAS2770_TDMConfigurationReg9_TEMPTX_Mask (0x1 << 6)
#define TAS2770_TDMConfigurationReg9_TEMPTX_Disable (0x0 << 6)
#define TAS2770_TDMConfigurationReg9_TEMPTX_Enable (0x1 << 6)
#define TAS2770_TDMConfigurationReg9_TEMPSLOT50_Mask (0x3f << 0)
- // TDM Configuration Reg10
+ /* TDM Configuration Reg10 */
#define TAS2770_TDMConfigurationReg10 TAS2770_REG(0X0, 0x14)
#define TAS2770_TDMConfigurationReg10_GAINTX_Mask (0x1 << 6)
#define TAS2770_TDMConfigurationReg10_GAINTX_Disable (0x0 << 6)
#define TAS2770_TDMConfigurationReg10_GAINTX_Enable (0x1 << 6)
#define TAS2770_TDMConfigurationReg10_GAINSLOT50_Mask (0x3f << 0)
- // Limiter Configuration Reg0
+ /* Limiter Configuration Reg0 */
#define TAS2770_LimiterConfigurationReg0 TAS2770_REG(0X0, 0x15)
#define TAS2770_LimiterConfigurationReg0_LIMATKST54_Mask (0x3 << 4)
#define TAS2770_LimiterConfigurationReg0_LIMATKST54_1 (0x2 << 4)
#define TAS2770_LimiterConfigurationReg0_LIMEN_Disabled (0x0 << 0)
#define TAS2770_LimiterConfigurationReg0_LIMEN_Enabled (0x1 << 0)
- // Limiter Configuration Reg1
+ /* Limiter Configuration Reg1 */
#define TAS2770_LimiterConfigurationReg1 TAS2770_REG(0X0, 0x16)
#define TAS2770_LimiterConfigurationReg1_LIMRLSST76_Mask (0x3 << 6)
#define TAS2770_LimiterConfigurationReg1_LIMRLSST76_1 (0x2 << 6)
#define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_500 (0x6 << 0)
#define TAS2770_LimiterConfigurationReg1_LIMHLDTM20_1000 (0x7 << 0)
- // Limiter Configuration Reg2
+ /* Limiter Configuration Reg2 */
#define TAS2770_LimiterConfigurationReg2 TAS2770_REG(0X0, 0x17)
#define TAS2770_LimiterConfigurationReg2_LIMMAXATN40_Mask (0x1f << 0)
- // Limiter Configuration Reg3
+ /* Limiter Configuration Reg3 */
#define TAS2770_LimiterConfigurationReg3 TAS2770_REG(0X0, 0x18)
#define TAS2770_LimiterConfigurationReg3_LIMTHMAX60_Mask (0x7f << 0)
- // Limiter Configuration Reg4
+ /* Limiter Configuration Reg4 */
#define TAS2770_LimiterConfigurationReg4 TAS2770_REG(0X0, 0x19)
#define TAS2770_LimiterConfigurationReg4_LIMTHMIN60_Mask (0x7f << 0)
- // Limiter Configuration Reg5
+ /* Limiter Configuration Reg5 */
#define TAS2770_LimiterConfigurationReg5 TAS2770_REG(0X0, 0x1A)
#define TAS2770_LimiterConfigurationReg5_LIMINFPOINT_Mask (0x7f << 0)
- // Brown Out Prevention Reg0
+ /* Brown Out Prevention Reg0 */
#define TAS2770_BrownOutPreventionReg0 TAS2770_REG(0X0, 0x1B)
#define TAS2770_BrownOutPreventionReg0_LIMSLOPE54_Mask (0x3 << 4)
#define TAS2770_BrownOutPreventionReg0_LIMSLOPE54_1 (0x0 << 4)
#define TAS2770_BrownOutPreventionReg0_BOPEN_Disabled (0x0 << 0)
#define TAS2770_BrownOutPreventionReg0_BOPEN_Enabled (0x1 << 0)
- // Brown Out Prevention Reg1
+ /* Brown Out Prevention Reg1 */
#define TAS2770_BrownOutPreventionReg1 TAS2770_REG(0X0, 0x1C)
#define TAS2770_BrownOutPreventionReg1_BOPTH70_Mask (0xff << 0)
- // Brown Out Prevention Reg2
+ /* Brown Out Prevention Reg2 */
#define TAS2770_BrownOutPreventionReg2 TAS2770_REG(0X0, 0x1D)
#define TAS2770_BrownOutPreventionReg2_BOPATKRT75_Mask (0x7 << 5)
#define TAS2770_BrownOutPreventionReg2_BOPATKRT75_5 (0x0 << 5)
#define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_500 (0x6 << 0)
#define TAS2770_BrownOutPreventionReg2_BOPHLDTM20_1000 (0x7 << 0)
- // ICLA Reg0
+ /* ICLA Reg0 */
#define TAS2770_ICLAReg0 TAS2770_REG(0X0, 0x1E)
#define TAS2770_ICLAReg0_ICLAUSEMAX_Mask (0x1 << 7)
#define TAS2770_ICLAReg0_ICLAUSEMAX_Min (0x0 << 7)
#define TAS2770_ICLAReg0_ICLAEN_Disabled (0x0 << 0)
#define TAS2770_ICLAReg0_ICLAEN_Enabled (0x1 << 0)
- // ICLA Reg1
+ /* ICLA Reg1 */
#define TAS2770_ICLAReg1 TAS2770_REG(0X0, 0x1F)
#define TAS2770_ICLAReg1_ICLASEN_Mask (0xff << 0)
#define TAS2770_ICLAReg1_ICLASLOT_7_Disable (0x0 << 7)
#define TAS2770_ICLAReg1_ICLASLOT_0_Disable (0x0 << 0)
#define TAS2770_ICLAReg1_ICLASLOT_0_Enable (0x1 << 0)
- // Interrupt Mask Reg0
+ /* Interrupt Mask Reg0 */
#define TAS2770_InterruptMaskReg0 TAS2770_REG(0X0, 0x20)
#define TAS2770_InterruptMaskReg0_LIMMUTEINTMASK_Mask (0x1 << 7)
#define TAS2770_InterruptMaskReg0_LIMMUTEINTMASK_Unmask (0x0 << 7)
#define TAS2770_InterruptMaskReg0_OTEINTMASK_Unmask (0x0 << 0)
#define TAS2770_InterruptMaskReg0_OTEINTMASK_Disable (0x1 << 0)
- // Interrupt Mask Reg1
+ /* Interrupt Mask Reg1 */
#define TAS2770_InterruptMaskReg1 TAS2770_REG(0X0, 0x21)
#define TAS2770_InterruptMaskReg1_PDMAUDDATAINVALIDINTMASK_Mask (0x1 << 7)
#define TAS2770_InterruptMaskReg1_PDMAUDDATAINVALIDINTMASK_Unmask (0x0 << 7)
#define TAS2770_InterruptMaskReg1_PDMClockErrorINTMASK_Unmask (0x0 << 0)
#define TAS2770_InterruptMaskReg1_PDMClockErrorINTMASK_Disable (0x1 << 0)
- // Live-Interrupt Reg0
+ /* Live-Interrupt Reg0 */
#define TAS2770_LiveInterruptReg0 TAS2770_REG(0X0, 0x22)
#define TAS2770_LiveInterruptReg0_LIMMUTE_Mask (0x1 << 7)
#define TAS2770_LiveInterruptReg0_LIMMUTE_NoInterrupt (0x0 << 7)
#define TAS2770_LiveInterruptReg0_OTEFlag_NoInterrupt (0x0 << 0)
#define TAS2770_LiveInterruptReg0_OTEFlag_Interrupt (0x1 << 0)
- // Live-Interrupt Reg1
+ /* Live-Interrupt Reg1 */
#define TAS2770_LiveInterruptReg1 TAS2770_REG(0X0, 0x23)
#define TAS2770_LiveInterruptReg1_PDMAUDDATAINVALID_Mask (0x1 << 7)
#define TAS2770_LiveInterruptReg1_PDMAUDDATAINVALID_NoInterrupt (0x0 << 7)
#define TAS2770_LiveInterruptReg1_PDMClockError_NoInterrupt (0x0 << 0)
#define TAS2770_LiveInterruptReg1_PDMClockError_Interrupt (0x1 << 0)
- // Latched-Interrupt Reg0
+ /* Latched-Interrupt Reg0 */
#define TAS2770_LatchedInterruptReg0 TAS2770_REG(0X0, 0x24)
#define TAS2770_LatchedInterruptReg0_LIMMUTESticky_Mask (0x1 << 7)
#define TAS2770_LatchedInterruptReg0_LIMMUTESticky_NoInterrupt (0x0 << 7)
#define TAS2770_LatchedInterruptReg0_LIMMAXATNSticky_NoInterrupt (0x0 << 5)
#define TAS2770_LatchedInterruptReg0_LIMMAXATNSticky_Interrupt (0x1 << 5)
#define TAS2770_LatchedInterruptReg0_VBATLessthanINFSticky_Mask (0x1 << 4)
-#define TAS2770_LatchedInterruptReg0_VBATLessthanINFSticky_NoInterrupt (0x0 << 4)
+#define TAS2770_LatchedInterruptReg0_VBATLessthanINFSticky_NoInterrupt \
+ (0x0 << 4)
#define TAS2770_LatchedInterruptReg0_VBATLessthanINFSticky_Interrupt (0x1 << 4)
#define TAS2770_LatchedInterruptReg0_LIMActiveFlagSticky_Mask (0x1 << 3)
#define TAS2770_LatchedInterruptReg0_LIMActiveFlagSticky_NoInterrupt (0x0 << 3)
#define TAS2770_LatchedInterruptReg0_OTEFlagSticky_NoInterrupt (0x0 << 0)
#define TAS2770_LatchedInterruptReg0_OTEFlagSticky_Interrupt (0x1 << 0)
- // Latched-Interrupt Reg1
+ /* Latched-Interrupt Reg1 */
#define TAS2770_LatchedInterruptReg1 TAS2770_REG(0X0, 0x25)
#define TAS2770_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_Mask (0x1 << 7)
-#define TAS2770_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_NoInterrupt (0x0 << 7)
-#define TAS2770_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_Interrupt (0x1 << 7)
+#define TAS2770_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_NoInterrupt \
+ (0x0 << 7)
+#define TAS2770_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_Interrupt \
+ (0x1 << 7)
#define TAS2770_LatchedInterruptReg1_VBATOVLOSticky_Mask (0x1 << 3)
#define TAS2770_LatchedInterruptReg1_VBATOVLOSticky_NoInterrupt (0x0 << 3)
#define TAS2770_LatchedInterruptReg1_VBATOVLOSticky_Interrupt (0x1 << 3)
#define TAS2770_LatchedInterruptReg1_PDMClockErrorSticky_NoInterrupt (0x0 << 0)
#define TAS2770_LatchedInterruptReg1_PDMClockErrorSticky_Interrupt (0x1 << 0)
- // VBAT MSB
+ /* VBAT MSB */
#define TAS2770_VBATMSB TAS2770_REG(0X0, 0x27)
#define TAS2770_VBATMSB_VBATMSB70_Mask (0xff << 0)
- // VBAT LSB
+ /* VBAT LSB */
#define TAS2770_VBATLSB TAS2770_REG(0X0, 0x28)
#define TAS2770_VBATLSB_VBATLSB74_Mask (0xf << 4)
-
- // TEMP MSB
+
+ /* TEMP MSB */
#define TAS2770_TEMPMSB TAS2770_REG(0X0, 0x29)
#define TAS2770_TEMPMSB_TEMPMSB70_Mask (0xff << 0)
- // TEMP LSB
+ /* TEMP LSB */
#define TAS2770_TEMPLSB TAS2770_REG(0X0, 0x2A)
#define TAS2770_TEMPLSB_TEMPLSB74_Mask (0xf << 4)
- // SDZ Config
+ /* SDZ Config */
#define TAS2770_SDZCONFIG TAS2770_REG(0X0, 0x2F)
#define TAS2770_SDZCONFIG_ICLANONZEROMIN_Mask (0x1 << 4)
#define TAS2770_SDZCONFIG_ICLANONZEROMIN_Disable (0x0 << 4)
#define TAS2770_SDZCONFIG_SDZMODETIMEOUT_23p8ms (0x3 << 0)
- // Interrupt Configuration
+ /* Interrupt Configuration */
#define TAS2770_InterruptConfiguration TAS2770_REG(0X0, 0x30)
-#define TAS2770_InterruptConfiguration_INTTHRUSW_Mask (0x1 << 2),
+#define TAS2770_InterruptConfiguration_INTTHRUSW_Mask (0x1 << 2),
#define TAS2770_InterruptConfiguration_INTTHRUSW_IntOnIRQZ (0x0 << 2)
#define TAS2770_InterruptConfiguration_INTTHRUSW_IntFor2ms (0x1 << 2)
#define TAS2770_InterruptConfiguration_PININTConfig10_Mask (0x3 << 0)
-#define TAS2770_InterruptConfiguration_PININTConfig10_AssertOnLiveInterrupts (0x0 << 0)
-#define TAS2770_InterruptConfiguration_PININTConfig10_AssertOnLatchedInterrupts (0x1 << 0)
-#define TAS2770_InterruptConfiguration_PININTConfig10_Assert2msOnLiveInterrupts (0x2 << 0)
-#define TAS2770_InterruptConfiguration_PININTConfig10_Assert2msOnLatchedInterrupts (0x3 << 0)
-
- // Digital Input Pin Pull Down
+#define TAS2770_InterruptConfiguration_PININTConfig10_AssertOnLiveInterrupts \
+ (0x0 << 0)
+#define \
+TAS2770_InterruptConfiguration_PININTConfig10_AssertOnLatchedInterrupts \
+ (0x1 << 0)
+#define \
+TAS2770_InterruptConfiguration_PININTConfig10_Assert2msOnLiveInterrupts \
+ (0x2 << 0)
+#define \
+TAS2770_InterruptConfiguration_PININTConfig10_Assert2msOnLatchedInterrupts \
+ (0x3 << 0)
+
+ /* Digital Input Pin Pull Down */
#define TAS2770_DigitalInputPinPullDown TAS2770_REG(0X0, 0x31)
#define TAS2770_DigitalInputPinPullDown_WKPulldownSDOUT_Mask (0x1 << 7)
#define TAS2770_DigitalInputPinPullDown_WKPulldownSDOUT_Disabled (0x0 << 7)
#define TAS2770_DigitalInputPinPullDown_WKPulldownPDMCK1_Disabled (0x0 << 0)
#define TAS2770_DigitalInputPinPullDown_WKPulldownPDMCK1_Enabled (0x1 << 0)
- // Misc IRQ
+ /* Misc IRQ */
#define TAS2770_MiscIRQ TAS2770_REG(0X0, 0x32)
#define TAS2770_MiscIRQ_IRQZREQD_Mask (0x1 << 7)
#define TAS2770_MiscIRQ_IRQZREQD_ActiveHigh (0x0 << 7)
#define TAS2770_MiscIRQ_IRQZBITBANG_Mask (0x1 << 0)
#define TAS2770_MiscIRQ_IRQZBITBANG_IRQZInputBuf0 (0x0 << 0)
#define TAS2770_MiscIRQ_IRQZBITBANG_IRQZInputBuf1 (0x1 << 0)
-
- // Clock Configuration
+
+ /* Clock Configuration */
#define TAS2770_ClockConfiguration TAS2770_REG(0X0, 0x3C)
#define TAS2770_ClockConfiguration_SBCLKtoFS52_Mask (0xf << 2)
#define TAS2770_ClockConfiguration_SBCLKtoFS52_16 (0x0 << 2)
#define TAS2770_ClockConfiguration_DISCLKRateDetect10_Disabled (0x1 << 0)
#define TAS2770_ClockConfiguration_DISCLKRateDetect10_Enabled (0x0 << 0)
-
+
#define TAS2770_BDIVSelection_BCLKMaster TAS2770_REG(0X0, 0x3D)
#define TAS2770_BDIVSelection_BCLKMaster_ClockSource10_Mask (0x3 << 0)
#define TAS2770_BDIVSelection_BCLKMaster_ClockSource10_NDIV2Output (0x0 << 0)
#define TAS2770_BDIVSelection_HOLDSARUPDATE10_Enabled (0x1 << 0)
- // TDM Clock detection monitor
+ /* TDM Clock detection monitor */
#define TAS2770_TDMClockdetectionmonitor TAS2770_REG(0X0, 0x77)
#define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_Mask (0xf << 3)
#define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_16 (0x0 << 3)
#define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_256 (0x8 << 3)
#define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_384 (0x9 << 3)
#define TAS2770_TDMClockdetectionmonitor_SBCLKtoFSYNC63_512 (0xf << 3)
-#define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_Mask (0x7 << 0),
+#define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_Mask (0x7 << 0),
#define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_8khz (0x0 << 0)
#define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_16khz (0x1 << 0)
#define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_32khz (0x2 << 0)
#define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_96khz (0x4 << 0)
#define TAS2770_TDMClockdetectionmonitor_DetectedSampleRate20_192khz (0x5 << 0)
- // Revision and PG ID
+ /* Revision and PG ID */
#define TAS2770_RevisionandPGID TAS2770_REG(0X0, 0x7D)
#define TAS2770_RevisionandPGID_RevisionID74_Mask (0xf << 4)
#define TAS2770_RevisionandPGID_PGID30_Mask (0xf << 0)
- // I2C Checksum
+ /* I2C Checksum */
#define TAS2770_I2CChecksum TAS2770_REG(0X0, 0x7E)
#define TAS2770_I2CChecksum_I2CChecksum70_Mask (0xff << 0)
- // Book
+ /* Book */
#define TAS2770_Book TAS2770_REG(0X0, 0x7F)
#define TAS2770_Book_Book70_Mask (0xff << 0)
#define TAS2770_RegisterCount 55
-
-
#define ERROR_NONE 0x0000000
#define ERROR_PLL_ABSENT 0x0000000
#define ERROR_DEVA_I2C_COMM 0x0000000
#define ERROR_FAILSAFE 0x4000000
struct tas2770_register {
- int book;
- int page;
- int reg;
+ int book;
+ int page;
+ int reg;
};
struct tas2770_dai_cfg {
- unsigned int dai_fmt;
- unsigned int tdm_delay;
+ unsigned int dai_fmt;
+ unsigned int tdm_delay;
};
struct tas2770_priv {
- struct device *dev;
- struct regmap *regmap;
- struct mutex dev_lock;
- struct delayed_work irq_work;
- struct hrtimer mtimer;
- int mnClkin;
- int mnClkid;
- bool mbPowerUp;
- int mnCurrentBook;
- int mnCurrentPage;
- int mnLoad;
- int mnASIFormat;
- int mnResetGPIO;
- int mnIRQGPIO;
- int mnIRQ;
- bool mbIRQEnable;
- int mnSamplingRate;
- int mnFrameSize;
- int mnPLL;
- int mnPPG;
- int ch_size;
-
- void (*hw_reset)(struct tas2770_priv *pTAS2770);
- void (*clearIRQ)(struct tas2770_priv *pTAS2770);
- void (*enableIRQ)(struct tas2770_priv *pTAS2770, bool enable);
- /* device is working, but system is suspended */
- int (*runtime_suspend)(struct tas2770_priv *pTAS2770);
- int (*runtime_resume)(struct tas2770_priv *pTAS2770);
- bool mbRuntimeSuspend;
-
- unsigned int mnErrCode;
+ struct device *dev;
+ struct regmap *regmap;
+ struct mutex dev_lock;
+ struct delayed_work irq_work;
+ struct hrtimer mtimer;
+ int mnClkin;
+ int mnClkid;
+ bool mbPowerUp;
+ int mnCurrentBook;
+ int mnCurrentPage;
+ int mnLoad;
+ int mnASIFormat;
+ int mnResetGPIO;
+ int mnIRQGPIO;
+ int mnIRQ;
+ bool mbIRQEnable;
+ int mnSamplingRate;
+ int mnFrameSize;
+ int mnPLL;
+ int mnPPG;
+ int ch_size;
+ void (*hw_reset)(struct tas2770_priv *pTAS2770);
+ void (*clearIRQ)(struct tas2770_priv *pTAS2770);
+ void (*enableIRQ)(struct tas2770_priv *pTAS2770, bool enable);
+ /* device is working, but system is suspended */
+ int (*runtime_suspend)(struct tas2770_priv *pTAS2770);
+ int (*runtime_resume)(struct tas2770_priv *pTAS2770);
+ bool mbRuntimeSuspend;
+
+ unsigned int mnErrCode;
#ifdef CONFIG_TAS2770_CODEC
- struct mutex codec_lock;
-#endif
-
-#ifdef CONFIG_TAS2770_MISC
- int mnDBGCmd;
- int mnCurrentReg;
- struct mutex file_lock;
+ struct mutex codec_lock;
#endif
};
-#endif // __TAS2770_
+#endif /* __TAS2770_ */