From: Maxime Ripard <maxime.ripard@free-electrons.com> To: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: thomas@free-electrons.com, patrice.vilchez@atmel.com, nicolas.ferre@atmel.com, plagnioj@jcrosoft.com Subject: [PATCH 1/9] ARM: AT91: Add platform data for the AT91 ADCs Date: Wed, 9 May 2012 11:05:58 +0200 [thread overview] Message-ID: <1336554366-16957-2-git-send-email-maxime.ripard@free-electrons.com> (raw) In-Reply-To: <1336554366-16957-1-git-send-email-maxime.ripard@free-electrons.com> The AT91 SoCs often embeds an ADC. This patch adds the needed platform data to specify the informations required by the driver to work properly. For now, we only need the reference voltage and which channels are available on the board. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> --- include/linux/platform_data/at91_adc.h | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 include/linux/platform_data/at91_adc.h diff --git a/include/linux/platform_data/at91_adc.h b/include/linux/platform_data/at91_adc.h new file mode 100644 index 0000000..f9e2f00 --- /dev/null +++ b/include/linux/platform_data/at91_adc.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 Free Electrons + * + * Licensed under the GPLv2 or later. + */ + +#ifndef _AT91_ADC_H_ +#define _AT91_ADC_H_ + +/** + * struct at91_adc_reg_desc - Various informations relative to registers + * @channel_base: Base address for the channel data registers + * @drdy_mask: Mask of the DRDY field in the relevant registers + (Interruptions registers mostly) + * @status_register: Address of the Interrupt Status Register + * @trigger_register: Address of the Trigger setup register + */ +struct at91_adc_reg_desc { + u8 channel_base; + u32 drdy_mask; + u8 status_register; + u8 trigger_register; +}; + +/** + * struct at91_adc_trigger - description of triggers + * @name: name of the trigger advertised to the user + * @value: value to set in the ADC's mode register to enable + the trigger + * @is_external: is the trigger relies on an external pin ? + */ +struct at91_adc_trigger { + const char *name; + u8 value; + bool is_external; +}; + +/** + * struct at91_adc_data - platform data for ADC driver + * @channels_used: channels in use on the board as a bitmask + * @num_channels: global number of channels available on the board + * @registers: Registers definition on the board + * @startup_time: startup time of the ADC in microseconds + * @trigger_list: Triggers available in the ADC + * @trigger_number: Number of triggers available in the ADC + * @use_external_triggers: does the board has external triggers availables + * @vref: Reference voltage for the ADC in millivolts + */ +struct at91_adc_data { + unsigned long channels_used; + u8 num_channels; + struct at91_adc_reg_desc *registers; + u8 startup_time; + struct at91_adc_trigger *trigger_list; + u8 trigger_number; + bool use_external_triggers; + u16 vref; +}; + +extern void __init at91_add_device_adc(struct at91_adc_data *data); +#endif -- 1.7.9.5
WARNING: multiple messages have this Message-ID (diff)
From: maxime.ripard@free-electrons.com (Maxime Ripard) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/9] ARM: AT91: Add platform data for the AT91 ADCs Date: Wed, 9 May 2012 11:05:58 +0200 [thread overview] Message-ID: <1336554366-16957-2-git-send-email-maxime.ripard@free-electrons.com> (raw) In-Reply-To: <1336554366-16957-1-git-send-email-maxime.ripard@free-electrons.com> The AT91 SoCs often embeds an ADC. This patch adds the needed platform data to specify the informations required by the driver to work properly. For now, we only need the reference voltage and which channels are available on the board. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> --- include/linux/platform_data/at91_adc.h | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 include/linux/platform_data/at91_adc.h diff --git a/include/linux/platform_data/at91_adc.h b/include/linux/platform_data/at91_adc.h new file mode 100644 index 0000000..f9e2f00 --- /dev/null +++ b/include/linux/platform_data/at91_adc.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 Free Electrons + * + * Licensed under the GPLv2 or later. + */ + +#ifndef _AT91_ADC_H_ +#define _AT91_ADC_H_ + +/** + * struct at91_adc_reg_desc - Various informations relative to registers + * @channel_base: Base address for the channel data registers + * @drdy_mask: Mask of the DRDY field in the relevant registers + (Interruptions registers mostly) + * @status_register: Address of the Interrupt Status Register + * @trigger_register: Address of the Trigger setup register + */ +struct at91_adc_reg_desc { + u8 channel_base; + u32 drdy_mask; + u8 status_register; + u8 trigger_register; +}; + +/** + * struct at91_adc_trigger - description of triggers + * @name: name of the trigger advertised to the user + * @value: value to set in the ADC's mode register to enable + the trigger + * @is_external: is the trigger relies on an external pin ? + */ +struct at91_adc_trigger { + const char *name; + u8 value; + bool is_external; +}; + +/** + * struct at91_adc_data - platform data for ADC driver + * @channels_used: channels in use on the board as a bitmask + * @num_channels: global number of channels available on the board + * @registers: Registers definition on the board + * @startup_time: startup time of the ADC in microseconds + * @trigger_list: Triggers available in the ADC + * @trigger_number: Number of triggers available in the ADC + * @use_external_triggers: does the board has external triggers availables + * @vref: Reference voltage for the ADC in millivolts + */ +struct at91_adc_data { + unsigned long channels_used; + u8 num_channels; + struct at91_adc_reg_desc *registers; + u8 startup_time; + struct at91_adc_trigger *trigger_list; + u8 trigger_number; + bool use_external_triggers; + u16 vref; +}; + +extern void __init at91_add_device_adc(struct at91_adc_data *data); +#endif -- 1.7.9.5
next prev parent reply other threads:[~2012-05-09 9:06 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-05-09 9:05 [PATCHv3] Add ADC driver for Atmel G20, G45 and X5 boards Maxime Ripard 2012-05-09 9:05 ` Maxime Ripard 2012-05-09 9:05 ` Maxime Ripard [this message] 2012-05-09 9:05 ` [PATCH 1/9] ARM: AT91: Add platform data for the AT91 ADCs Maxime Ripard 2012-05-09 13:04 ` Jonathan Cameron 2012-05-09 13:04 ` Jonathan Cameron 2012-05-09 9:05 ` [PATCH 2/9] ARM: AT91: IIO: Add AT91 ADC driver Maxime Ripard 2012-05-09 9:05 ` Maxime Ripard 2012-05-09 9:06 ` [PATCH 3/9] ARM: AT91: Add the ADC to the sam9g20ek board Maxime Ripard 2012-05-09 9:06 ` Maxime Ripard 2012-05-09 9:06 ` [PATCH 4/9] IIO: AT91: ADC: Add support for the AT91SAM9M10G45-EK board Maxime Ripard 2012-05-09 9:06 ` Maxime Ripard 2012-05-09 9:06 ` [PATCH 5/9] Add clocks for X5 boards Maxime Ripard 2012-05-09 9:06 ` Maxime Ripard 2012-05-09 9:06 ` [PATCH 6/9] IIO: AT91: Add DT support to at91_adc driver Maxime Ripard 2012-05-09 9:06 ` Maxime Ripard 2012-05-09 9:06 ` [PATCH 7/9] Add ADC driver to the at91sam9g45 dtsi Maxime Ripard 2012-05-09 9:06 ` Maxime Ripard 2012-05-09 9:06 ` [PATCH 8/9] Add ADC driver to the at91sam9x5 dtsi Maxime Ripard 2012-05-09 9:06 ` Maxime Ripard 2012-05-09 9:06 ` [PATCH 9/9] Add DTSI for the G20 SoC Maxime Ripard 2012-05-09 9:06 ` Maxime Ripard 2012-05-09 14:18 ` [PATCHv3] Add ADC driver for Atmel G20, G45 and X5 boards Nicolas Ferre 2012-05-09 14:18 ` Nicolas Ferre 2012-05-09 14:46 ` Arnd Bergmann 2012-05-09 14:46 ` Arnd Bergmann 2012-05-09 14:40 ` Arnd Bergmann 2012-05-09 14:40 ` Arnd Bergmann 2012-05-10 8:32 ` Maxime Ripard 2012-05-10 8:32 ` Maxime Ripard 2012-05-10 8:50 ` Nicolas Ferre 2012-05-10 8:50 ` Nicolas Ferre 2012-05-10 13:28 ` Arnd Bergmann 2012-05-10 13:28 ` Arnd Bergmann 2012-05-11 7:54 ` Maxime Ripard 2012-05-11 7:54 ` Maxime Ripard 2012-05-11 12:26 ` Jonathan Cameron 2012-05-11 12:26 ` Jonathan Cameron 2012-05-09 13:01 [PATCHv4] " Maxime Ripard 2012-05-09 13:02 ` [PATCH 1/9] ARM: AT91: Add platform data for the AT91 ADCs Maxime Ripard 2012-05-09 13:02 ` Maxime Ripard 2012-05-11 13:35 [PATCHv5] Add ADC driver for Atmel G20, G45 and X5 boards Maxime Ripard 2012-05-11 13:35 ` [PATCH 1/9] ARM: AT91: Add platform data for the AT91 ADCs Maxime Ripard 2012-05-11 13:35 ` Maxime Ripard
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1336554366-16957-2-git-send-email-maxime.ripard@free-electrons.com \ --to=maxime.ripard@free-electrons.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-iio@vger.kernel.org \ --cc=nicolas.ferre@atmel.com \ --cc=patrice.vilchez@atmel.com \ --cc=plagnioj@jcrosoft.com \ --cc=thomas@free-electrons.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.