Peter Ujfalusi | 493b67e | 2009-10-09 15:55:41 +0300 | [diff] [blame] | 1 | /* |
| 2 | * ALSA SoC TPA6130A2 amplifier driver |
| 3 | * |
| 4 | * Copyright (C) Nokia Corporation |
| 5 | * |
Peter Ujfalusi | b4079ef | 2011-05-03 18:12:41 +0300 | [diff] [blame] | 6 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> |
Peter Ujfalusi | 493b67e | 2009-10-09 15:55:41 +0300 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License |
| 10 | * version 2 as published by the Free Software Foundation. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 20 | * 02110-1301 USA |
| 21 | * |
| 22 | */ |
| 23 | |
| 24 | #ifndef __TPA6130A2_H__ |
| 25 | #define __TPA6130A2_H__ |
| 26 | |
| 27 | /* Register addresses */ |
| 28 | #define TPA6130A2_REG_CONTROL 0x01 |
| 29 | #define TPA6130A2_REG_VOL_MUTE 0x02 |
| 30 | #define TPA6130A2_REG_OUT_IMPEDANCE 0x03 |
| 31 | #define TPA6130A2_REG_VERSION 0x04 |
| 32 | |
Peter Ujfalusi | 493b67e | 2009-10-09 15:55:41 +0300 | [diff] [blame] | 33 | /* Register bits */ |
| 34 | /* TPA6130A2_REG_CONTROL (0x01) */ |
Helen Koike | 6d2de5a | 2016-06-23 16:23:13 -0300 | [diff] [blame] | 35 | #define TPA6130A2_SWS_SHIFT 0 |
| 36 | #define TPA6130A2_SWS (0x01 << TPA6130A2_SWS_SHIFT) |
Peter Ujfalusi | 493b67e | 2009-10-09 15:55:41 +0300 | [diff] [blame] | 37 | #define TPA6130A2_TERMAL (0x01 << 1) |
| 38 | #define TPA6130A2_MODE(x) (x << 4) |
| 39 | #define TPA6130A2_MODE_STEREO (0x00) |
| 40 | #define TPA6130A2_MODE_DUAL_MONO (0x01) |
| 41 | #define TPA6130A2_MODE_BRIDGE (0x02) |
| 42 | #define TPA6130A2_MODE_MASK (0x03) |
Helen Koike | 6d2de5a | 2016-06-23 16:23:13 -0300 | [diff] [blame] | 43 | #define TPA6130A2_HP_EN_R_SHIFT 6 |
| 44 | #define TPA6130A2_HP_EN_R (0x01 << TPA6130A2_HP_EN_R_SHIFT) |
| 45 | #define TPA6130A2_HP_EN_L_SHIFT 7 |
| 46 | #define TPA6130A2_HP_EN_L (0x01 << TPA6130A2_HP_EN_L_SHIFT) |
Peter Ujfalusi | 493b67e | 2009-10-09 15:55:41 +0300 | [diff] [blame] | 47 | |
| 48 | /* TPA6130A2_REG_VOL_MUTE (0x02) */ |
| 49 | #define TPA6130A2_VOLUME(x) ((x & 0x3f) << 0) |
| 50 | #define TPA6130A2_MUTE_R (0x01 << 6) |
| 51 | #define TPA6130A2_MUTE_L (0x01 << 7) |
| 52 | |
| 53 | /* TPA6130A2_REG_OUT_IMPEDANCE (0x03) */ |
| 54 | #define TPA6130A2_HIZ_R (0x01 << 0) |
| 55 | #define TPA6130A2_HIZ_L (0x01 << 1) |
| 56 | |
| 57 | /* TPA6130A2_REG_VERSION (0x04) */ |
| 58 | #define TPA6130A2_VERSION_MASK (0x0f) |
| 59 | |
Peter Ujfalusi | 493b67e | 2009-10-09 15:55:41 +0300 | [diff] [blame] | 60 | #endif /* __TPA6130A2_H__ */ |