diff options
| author | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-13 06:14:59 -0400 |
|---|---|---|
| committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-13 06:14:59 -0400 |
| commit | d8c5d658f425bd25bbfb137f2617f59ed4fdee7d (patch) | |
| tree | ba1607f9cc0fb8c3ac246a78490d3e5b8438f44e /include/linux/mfd | |
| parent | a1ace0aac5a83b859c2ddeb5dfb032b9b6dcd9cf (diff) | |
| parent | 1460c152c53335b5403045d056502eda1204c33a (diff) | |
Merge tag 'am335x_tsc-adc' of git://breakpoint.cc/bigeasy/linux
A complete refurbished series inclunding:
- DT support for the MFD, TSC and ADC driver & platform device support,
which has no users, has been killed.
- iio_map from last series is gone and replaced by proper nodes in the
device tree.
- suspend fixes which means correct data structs are taken and no
interrupt storm
- fifo split which should problem with TSC & ADC beeing used at the same
time
- The ADC channels are now checked before blindly applied. That means the
touch part reads X, Y and Z coordinates and does not mix them up. Same
goes for the IIO ADC driver.
- The IIO ADC driver now creates files named in_voltageX_raw where X
represents the ADC line instead of a number starting at 0. A read from
this file can return -EBUSY in case touch is busy and the ADC didn't
collect a value.
Diffstat (limited to 'include/linux/mfd')
| -rw-r--r-- | include/linux/mfd/ti_am335x_tscadc.h | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index c79ad5d2f271..8d73fe29796a 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h | |||
| @@ -30,8 +30,8 @@ | |||
| 30 | #define REG_IDLECONFIG 0x058 | 30 | #define REG_IDLECONFIG 0x058 |
| 31 | #define REG_CHARGECONFIG 0x05C | 31 | #define REG_CHARGECONFIG 0x05C |
| 32 | #define REG_CHARGEDELAY 0x060 | 32 | #define REG_CHARGEDELAY 0x060 |
| 33 | #define REG_STEPCONFIG(n) (0x64 + ((n - 1) * 8)) | 33 | #define REG_STEPCONFIG(n) (0x64 + ((n) * 8)) |
| 34 | #define REG_STEPDELAY(n) (0x68 + ((n - 1) * 8)) | 34 | #define REG_STEPDELAY(n) (0x68 + ((n) * 8)) |
| 35 | #define REG_FIFO0CNT 0xE4 | 35 | #define REG_FIFO0CNT 0xE4 |
| 36 | #define REG_FIFO0THR 0xE8 | 36 | #define REG_FIFO0THR 0xE8 |
| 37 | #define REG_FIFO1CNT 0xF0 | 37 | #define REG_FIFO1CNT 0xF0 |
| @@ -46,8 +46,6 @@ | |||
| 46 | /* Step Enable */ | 46 | /* Step Enable */ |
| 47 | #define STEPENB_MASK (0x1FFFF << 0) | 47 | #define STEPENB_MASK (0x1FFFF << 0) |
| 48 | #define STEPENB(val) ((val) << 0) | 48 | #define STEPENB(val) ((val) << 0) |
| 49 | #define STPENB_STEPENB STEPENB(0x1FFFF) | ||
| 50 | #define STPENB_STEPENB_TC STEPENB(0x1FFF) | ||
| 51 | 49 | ||
| 52 | /* IRQ enable */ | 50 | /* IRQ enable */ |
| 53 | #define IRQENB_HW_PEN BIT(0) | 51 | #define IRQENB_HW_PEN BIT(0) |
| @@ -73,8 +71,6 @@ | |||
| 73 | #define STEPCONFIG_INM_ADCREFM STEPCONFIG_INM(8) | 71 | #define STEPCONFIG_INM_ADCREFM STEPCONFIG_INM(8) |
| 74 | #define STEPCONFIG_INP_MASK (0xF << 19) | 72 | #define STEPCONFIG_INP_MASK (0xF << 19) |
| 75 | #define STEPCONFIG_INP(val) ((val) << 19) | 73 | #define STEPCONFIG_INP(val) ((val) << 19) |
| 76 | #define STEPCONFIG_INP_AN2 STEPCONFIG_INP(2) | ||
| 77 | #define STEPCONFIG_INP_AN3 STEPCONFIG_INP(3) | ||
| 78 | #define STEPCONFIG_INP_AN4 STEPCONFIG_INP(4) | 74 | #define STEPCONFIG_INP_AN4 STEPCONFIG_INP(4) |
| 79 | #define STEPCONFIG_INP_ADCREFM STEPCONFIG_INP(8) | 75 | #define STEPCONFIG_INP_ADCREFM STEPCONFIG_INP(8) |
| 80 | #define STEPCONFIG_FIFO1 BIT(26) | 76 | #define STEPCONFIG_FIFO1 BIT(26) |
| @@ -96,7 +92,6 @@ | |||
| 96 | #define STEPCHARGE_INM_AN1 STEPCHARGE_INM(1) | 92 | #define STEPCHARGE_INM_AN1 STEPCHARGE_INM(1) |
| 97 | #define STEPCHARGE_INP_MASK (0xF << 19) | 93 | #define STEPCHARGE_INP_MASK (0xF << 19) |
| 98 | #define STEPCHARGE_INP(val) ((val) << 19) | 94 | #define STEPCHARGE_INP(val) ((val) << 19) |
| 99 | #define STEPCHARGE_INP_AN1 STEPCHARGE_INP(1) | ||
| 100 | #define STEPCHARGE_RFM_MASK (3 << 23) | 95 | #define STEPCHARGE_RFM_MASK (3 << 23) |
| 101 | #define STEPCHARGE_RFM(val) ((val) << 23) | 96 | #define STEPCHARGE_RFM(val) ((val) << 23) |
| 102 | #define STEPCHARGE_RFM_XNUR STEPCHARGE_RFM(1) | 97 | #define STEPCHARGE_RFM_XNUR STEPCHARGE_RFM(1) |
| @@ -125,22 +120,17 @@ | |||
| 125 | 120 | ||
| 126 | #define TSCADC_CELLS 2 | 121 | #define TSCADC_CELLS 2 |
| 127 | 122 | ||
| 128 | enum tscadc_cells { | ||
| 129 | TSC_CELL, | ||
| 130 | ADC_CELL, | ||
| 131 | }; | ||
| 132 | |||
| 133 | struct mfd_tscadc_board { | ||
| 134 | struct tsc_data *tsc_init; | ||
| 135 | struct adc_data *adc_init; | ||
| 136 | }; | ||
| 137 | |||
| 138 | struct ti_tscadc_dev { | 123 | struct ti_tscadc_dev { |
| 139 | struct device *dev; | 124 | struct device *dev; |
| 140 | struct regmap *regmap_tscadc; | 125 | struct regmap *regmap_tscadc; |
| 141 | void __iomem *tscadc_base; | 126 | void __iomem *tscadc_base; |
| 142 | int irq; | 127 | int irq; |
| 128 | int used_cells; /* 1-2 */ | ||
| 129 | int tsc_cell; /* -1 if not used */ | ||
| 130 | int adc_cell; /* -1 if not used */ | ||
| 143 | struct mfd_cell cells[TSCADC_CELLS]; | 131 | struct mfd_cell cells[TSCADC_CELLS]; |
| 132 | u32 reg_se_cache; | ||
| 133 | spinlock_t reg_lock; | ||
| 144 | 134 | ||
| 145 | /* tsc device */ | 135 | /* tsc device */ |
| 146 | struct titsc *tsc; | 136 | struct titsc *tsc; |
| @@ -149,4 +139,15 @@ struct ti_tscadc_dev { | |||
| 149 | struct adc_device *adc; | 139 | struct adc_device *adc; |
| 150 | }; | 140 | }; |
| 151 | 141 | ||
| 142 | static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p) | ||
| 143 | { | ||
| 144 | struct ti_tscadc_dev **tscadc_dev = p->dev.platform_data; | ||
| 145 | |||
| 146 | return *tscadc_dev; | ||
| 147 | } | ||
| 148 | |||
| 149 | void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc); | ||
| 150 | void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val); | ||
| 151 | void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); | ||
| 152 | |||
| 152 | #endif | 153 | #endif |
