blob: 9ca6a8cb341c1f98ca4e8476eec441fa42d9ae9c [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __MFD_TABLA_PDATA_H__
14
15#define __MFD_TABLA_PDATA_H__
16
17#include <linux/slimbus/slimbus.h>
18
Patrick Lai3043fba2011-08-01 14:15:57 -070019#define TABLA_LDOH_1P95_V 0x0
20#define TABLA_LDOH_2P35_V 0x1
21#define TABLA_LDOH_2P75_V 0x2
22#define TABLA_LDOH_2P85_V 0x3
23
24#define TABLA_CFILT1_SEL 0x0
25#define TABLA_CFILT2_SEL 0x1
26#define TABLA_CFILT3_SEL 0x2
27
Santosh Mardi22920282011-10-26 02:38:40 +053028#define MAX_AMIC_CHANNEL 7
29
30struct tabla_amic {
31 /*legacy mode, txfe_enable and txfe_buff take 7 input
32 * each bit represent the channel / TXFE number
33 * and numbered as below
34 * bit 0 = channel 1 / TXFE1_ENABLE / TXFE1_BUFF
35 * bit 1 = channel 2 / TXFE2_ENABLE / TXFE2_BUFF
36 * ...
37 * bit 7 = channel 7 / TXFE7_ENABLE / TXFE7_BUFF
38 */
39 u8 legacy_mode:MAX_AMIC_CHANNEL;
40 u8 txfe_enable:MAX_AMIC_CHANNEL;
41 u8 txfe_buff:MAX_AMIC_CHANNEL;
42 u8 use_pdata:MAX_AMIC_CHANNEL;
43};
44
Patrick Lai3043fba2011-08-01 14:15:57 -070045/* Each micbias can be assigned to one of three cfilters
46 * Vbatt_min >= .15V + ldoh_v
47 * ldoh_v >= .15v + cfiltx_mv
48 * If ldoh_v = 1.95 160 mv < cfiltx_mv < 1800 mv
49 * If ldoh_v = 2.35 200 mv < cfiltx_mv < 2200 mv
50 * If ldoh_v = 2.75 240 mv < cfiltx_mv < 2600 mv
51 * If ldoh_v = 2.85 250 mv < cfiltx_mv < 2700 mv
52 */
53
54struct tabla_micbias_setting {
55 u8 ldoh_v;
56 u32 cfilt1_mv; /* in mv */
57 u32 cfilt2_mv; /* in mv */
58 u32 cfilt3_mv; /* in mv */
59 u8 bias1_cfilt_sel;
60 u8 bias2_cfilt_sel;
61 u8 bias3_cfilt_sel;
62 u8 bias4_cfilt_sel;
63};
64
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070065struct tabla_pdata {
66 int irq;
67 int irq_base;
68 int num_irqs;
69 int reset_gpio;
Santosh Mardi22920282011-10-26 02:38:40 +053070 struct tabla_amic amic_settings;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070071 struct slim_device slimbus_slave_device;
Patrick Lai3043fba2011-08-01 14:15:57 -070072 struct tabla_micbias_setting micbias;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070073};
74
75#endif