Skip to content

Commit

Permalink
ARM:mstar: SAR adc driver
Browse files Browse the repository at this point in the history
  • Loading branch information
fifteenhex committed Jul 11, 2021
1 parent 92bc4e2 commit fb1c5e9
Show file tree
Hide file tree
Showing 6 changed files with 754 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/arm/boot/dts/mstar-infinity.dtsi
Expand Up @@ -53,3 +53,7 @@
<&pinctrl 26 68 6>;
status = "okay";
};

&sar {
compatible = "mstar,msc313e-sar";
};
4 changes: 4 additions & 0 deletions arch/arm/boot/dts/mstar-mercury5-ssc8336.dtsi
Expand Up @@ -42,3 +42,7 @@
/*<&intc_fiq 23 IRQ_TYPE_LEVEL_HIGH>;*/
status = "okay";
};

&sar {
compatible = "mstar,ssc8336-sar";
};
40 changes: 40 additions & 0 deletions arch/arm/boot/dts/mstar-v7.dtsi
Expand Up @@ -307,6 +307,46 @@
status = "disabled";
};

sar: sar@2800 {
reg = <0x2800 0x200>;
interrupts-extended = <&intc_irq GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>,
<&wakeintc 1 IRQ_TYPE_LEVEL_HIGH>,
<&wakeintc 6 IRQ_TYPE_LEVEL_HIGH>,
<&intc_fiq GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
<&intc_fiq GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
<&intc_fiq GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
<&intc_fiq GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "sar",
"wakeup",
"wakeup_gpio",
"sar_gpio0",
"sar_gpio1",
"sar_gpio2",
"sar_gpio3";
clock-names = "sar_clk";
clocks = <&pm_muxes MSC313_PM_MUXES_SAR>;
#gpio-cells = <2>;
mstar,pmsleep = <&pmsleep>;
wakeup-source;
status = "disabled";
sar0_gpio0_pins: sar0_gpio0 {
function = "sar0";
groups = "sar_gpio0";
};
sar1_gpio1_pins: sar1_gpio1 {
function = "sar1";
groups = "sar_gpio1";
};
sar2_gpio2_pins: sar2_gpio2 {
function = "sar2";
groups = "sar_gpio2";
};
sar3_gpio3_pins: sar3_gpio3 {
function = "sar3";
groups = "sar_gpio3";
};
};

wdt: wdt@6000 {
compatible = "mstar,msc313e-wdt";
reg = <0x6000 0x1f>;
Expand Down
17 changes: 17 additions & 0 deletions drivers/iio/adc/Kconfig
Expand Up @@ -1268,4 +1268,21 @@ config XILINX_XADC
The driver can also be build as a module. If so, the module will be called
xilinx-xadc.

config MSC313E_SAR
tristate "MStar MSC313E SAR driver"
depends on ARCH_MSTARV7 || COMPILE_TEST
depends on HAS_IOMEM
default ARCH_MSTARV7
select REGMAP_MMIO
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS
select GENERIC_PINCONF
select GPIOLIB_IRQCHIP
select IRQ_DOMAIN_HIERARCHY
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
imply SENSORS_IIO_HWMON
help
Say yes here to have support for the MSC313E SAR.

endmenu
1 change: 1 addition & 0 deletions drivers/iio/adc/Makefile
Expand Up @@ -114,3 +114,4 @@ obj-$(CONFIG_VIPERBOARD_ADC) += viperboard_adc.o
xilinx-xadc-y := xilinx-xadc-core.o xilinx-xadc-events.o
obj-$(CONFIG_XILINX_XADC) += xilinx-xadc.o
obj-$(CONFIG_SD_ADC_MODULATOR) += sd_adc_modulator.o
obj-$(CONFIG_MSC313E_SAR) += msc313e_sar.o

0 comments on commit fb1c5e9

Please sign in to comment.