Skip to content

Commit 2de0c01

Browse files
alexandrebelloniNicolas Ferre
authored andcommitted
iio: adc: at91: cleanup platform_data
num_channels and registers are not used anymore since they are defined inside the driver and assigned by matching the id_table. Also, struct at91_adc_reg_desc is now only used inside the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
1 parent acc8b8e commit 2de0c01

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

drivers/iio/adc/at91_adc.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,25 @@
4646
#define TOUCH_SAMPLE_PERIOD_US 2000 /* 2ms */
4747
#define TOUCH_PEN_DETECT_DEBOUNCE_US 200
4848

49+
/**
50+
* struct at91_adc_reg_desc - Various informations relative to registers
51+
* @channel_base: Base offset for the channel data registers
52+
* @drdy_mask: Mask of the DRDY field in the relevant registers
53+
(Interruptions registers mostly)
54+
* @status_register: Offset of the Interrupt Status Register
55+
* @trigger_register: Offset of the Trigger setup register
56+
* @mr_prescal_mask: Mask of the PRESCAL field in the adc MR register
57+
* @mr_startup_mask: Mask of the STARTUP field in the adc MR register
58+
*/
59+
struct at91_adc_reg_desc {
60+
u8 channel_base;
61+
u32 drdy_mask;
62+
u8 status_register;
63+
u8 trigger_register;
64+
u32 mr_prescal_mask;
65+
u32 mr_startup_mask;
66+
};
67+
4968
struct at91_adc_caps {
5069
bool has_ts; /* Support touch screen */
5170
bool has_tsmr; /* only at91sam9x5, sama5d3 have TSMR reg */

include/linux/platform_data/at91_adc.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,6 @@
77
#ifndef _AT91_ADC_H_
88
#define _AT91_ADC_H_
99

10-
/**
11-
* struct at91_adc_reg_desc - Various informations relative to registers
12-
* @channel_base: Base offset for the channel data registers
13-
* @drdy_mask: Mask of the DRDY field in the relevant registers
14-
(Interruptions registers mostly)
15-
* @status_register: Offset of the Interrupt Status Register
16-
* @trigger_register: Offset of the Trigger setup register
17-
* @mr_prescal_mask: Mask of the PRESCAL field in the adc MR register
18-
* @mr_startup_mask: Mask of the STARTUP field in the adc MR register
19-
*/
20-
struct at91_adc_reg_desc {
21-
u8 channel_base;
22-
u32 drdy_mask;
23-
u8 status_register;
24-
u8 trigger_register;
25-
u32 mr_prescal_mask;
26-
u32 mr_startup_mask;
27-
};
28-
2910
/**
3011
* struct at91_adc_trigger - description of triggers
3112
* @name: name of the trigger advertised to the user
@@ -42,8 +23,6 @@ struct at91_adc_trigger {
4223
/**
4324
* struct at91_adc_data - platform data for ADC driver
4425
* @channels_used: channels in use on the board as a bitmask
45-
* @num_channels: global number of channels available on the board
46-
* @registers: Registers definition on the board
4726
* @startup_time: startup time of the ADC in microseconds
4827
* @trigger_list: Triggers available in the ADC
4928
* @trigger_number: Number of triggers available in the ADC
@@ -52,8 +31,6 @@ struct at91_adc_trigger {
5231
*/
5332
struct at91_adc_data {
5433
unsigned long channels_used;
55-
u8 num_channels;
56-
struct at91_adc_reg_desc *registers;
5734
u8 startup_time;
5835
struct at91_adc_trigger *trigger_list;
5936
u8 trigger_number;

0 commit comments

Comments
 (0)