diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/input/ti_am335x_tsc.h | 23 | ||||
| -rw-r--r-- | include/linux/mfd/ti_am335x_tscadc.h | 35 | ||||
| -rw-r--r-- | include/linux/platform_data/ti_am335x_adc.h | 14 |
3 files changed, 18 insertions, 54 deletions
diff --git a/include/linux/input/ti_am335x_tsc.h b/include/linux/input/ti_am335x_tsc.h deleted file mode 100644 index 49269a2aa329..000000000000 --- a/include/linux/input/ti_am335x_tsc.h +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #ifndef __LINUX_TI_AM335X_TSC_H | ||
| 2 | #define __LINUX_TI_AM335X_TSC_H | ||
| 3 | |||
| 4 | /** | ||
| 5 | * struct tsc_data Touchscreen wire configuration | ||
| 6 | * @wires: Wires refer to application modes | ||
| 7 | * i.e. 4/5/8 wire touchscreen support | ||
| 8 | * on the platform. | ||
| 9 | * @x_plate_resistance: X plate resistance. | ||
| 10 | * @steps_to_configure: The sequencer supports a total of | ||
| 11 | * 16 programmable steps. | ||
| 12 | * A step configured to read a single | ||
| 13 | * co-ordinate value, can be applied | ||
| 14 | * more number of times for better results. | ||
| 15 | */ | ||
| 16 | |||
| 17 | struct tsc_data { | ||
| 18 | int wires; | ||
| 19 | int x_plate_resistance; | ||
| 20 | int steps_to_configure; | ||
| 21 | }; | ||
| 22 | |||
| 23 | #endif | ||
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 |
diff --git a/include/linux/platform_data/ti_am335x_adc.h b/include/linux/platform_data/ti_am335x_adc.h deleted file mode 100644 index e41d5834cb84..000000000000 --- a/include/linux/platform_data/ti_am335x_adc.h +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #ifndef __LINUX_TI_AM335X_ADC_H | ||
| 2 | #define __LINUX_TI_AM335X_ADC_H | ||
| 3 | |||
| 4 | /** | ||
| 5 | * struct adc_data ADC Input information | ||
| 6 | * @adc_channels: Number of analog inputs | ||
| 7 | * available for ADC. | ||
| 8 | */ | ||
| 9 | |||
| 10 | struct adc_data { | ||
| 11 | unsigned int adc_channels; | ||
| 12 | }; | ||
| 13 | |||
| 14 | #endif | ||
