Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85078fd0 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-4.15c' of...

Merge tag 'iio-for-4.15c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of new device support, cleanups and features for IIO in the 4.15 cycle

New device support
* ti-dac082s085 dac
  - new driver supporting 8, 10 and 12 bit TI DACs with 2 and 4 channels:
    DAC082S085, DAC102S085, DAC122S085, DAC104s085 and DAC124S085.

Minor features and cleanps
* adc12138
  - make array ch_to_mux static for small object code size reduction.
* sun4i-gpadc
  - use of_device_get_match_data rather than opencoding it.
* stm32 trigger
  - add tim15 tigger on STM32H7
  - check clock rate to avoid potential division by zero
* tsl2x7x staging cleanups.
  - move *_thresh_period to being created by IIO core.
  - remove unused tsl2x7x_parse_result structure.
  - sort includes
  - drop a repeat iio_dev forward definition
  - fix some code alignment of defines.
  - use IIO_CONST_ATTR for constant string attribute
  - drop some unnecessary parentheses
  - fix various alignment with parenthese
  - rename power defines for readability reasons
  - fix a missaligned break statement
  - Tidy up function definitions so they fit on a single line.
parents 7706abf5 f98677cf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -522,6 +522,7 @@ Description:
		Specifies the output powerdown mode.
		DAC output stage is disconnected from the amplifier and
		1kohm_to_gnd: connected to ground via an 1kOhm resistor,
		2.5kohm_to_gnd: connected to ground via a 2.5kOhm resistor,
		6kohm_to_gnd: connected to ground via a 6kOhm resistor,
		20kohm_to_gnd: connected to ground via a 20kOhm resistor,
		90kohm_to_gnd: connected to ground via a 90kOhm resistor,
+34 −0
Original line number Diff line number Diff line
Texas Instruments 8/10/12-bit 2/4-channel DAC driver

Required properties:
 - compatible:		Must be one of:
			"ti,dac082s085"
			"ti,dac102s085"
			"ti,dac122s085"
			"ti,dac084s085"
			"ti,dac104s085"
			"ti,dac124s085"
 - reg: 		Chip select number.
 - spi-cpha, spi-cpol:	SPI mode (0,1) or (1,0) must be used, so specify
			either spi-cpha or spi-cpol (but not both).
 - vref-supply: 	Phandle to the external reference voltage supply.

For other required and optional properties of SPI slave nodes please refer to
../../spi/spi-bus.txt.

Example:
	vref_2v5_reg: regulator-vref {
		compatible = "regulator-fixed";
		regulator-name = "2v5";
		regulator-min-microvolt = <2500000>;
		regulator-max-microvolt = <2500000>;
		regulator-always-on;
	};

	dac@0 {
		compatible = "ti,dac082s085";
		reg = <0>;
		spi-max-frequency = <40000000>;
		spi-cpol;
		vref-supply = <&vref_2v5_reg>;
	};
+13 −0
Original line number Diff line number Diff line
@@ -139,6 +139,11 @@ static int stm32f4_adc_clk_sel(struct platform_device *pdev,
	}

	rate = clk_get_rate(priv->aclk);
	if (!rate) {
		dev_err(&pdev->dev, "Invalid clock rate: 0\n");
		return -EINVAL;
	}

	for (i = 0; i < ARRAY_SIZE(stm32f4_pclk_div); i++) {
		if ((rate / stm32f4_pclk_div[i]) <= STM32F4_ADC_MAX_CLK_RATE)
			break;
@@ -216,6 +221,10 @@ static int stm32h7_adc_clk_sel(struct platform_device *pdev,
		 * From spec: PLL output musn't exceed max rate
		 */
		rate = clk_get_rate(priv->aclk);
		if (!rate) {
			dev_err(&pdev->dev, "Invalid adc clock rate: 0\n");
			return -EINVAL;
		}

		for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) {
			ckmode = stm32h7_adc_ckmodes_spec[i].ckmode;
@@ -232,6 +241,10 @@ static int stm32h7_adc_clk_sel(struct platform_device *pdev,

	/* Synchronous clock modes (e.g. ckmode is 1, 2 or 3) */
	rate = clk_get_rate(priv->bclk);
	if (!rate) {
		dev_err(&pdev->dev, "Invalid bus clock rate: 0\n");
		return -EINVAL;
	}

	for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) {
		ckmode = stm32h7_adc_ckmodes_spec[i].ckmode;
+1 −0
Original line number Diff line number Diff line
@@ -531,6 +531,7 @@ static struct stm32_adc_trig_info stm32h7_adc_trigs[] = {
	{ TIM2_TRGO, STM32_EXT11 },
	{ TIM4_TRGO, STM32_EXT12 },
	{ TIM6_TRGO, STM32_EXT13 },
	{ TIM15_TRGO, STM32_EXT14 },
	{ TIM3_CH4, STM32_EXT15 },
	{ LPTIM1_OUT, STM32_EXT18 },
	{ LPTIM2_OUT, STM32_EXT19 },
+2 −4
Original line number Diff line number Diff line
@@ -501,17 +501,15 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev,
				struct iio_dev *indio_dev)
{
	struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
	const struct of_device_id *of_dev;
	struct resource *mem;
	void __iomem *base;
	int ret;

	of_dev = of_match_device(sun4i_gpadc_of_id, &pdev->dev);
	if (!of_dev)
	info->data = of_device_get_match_data(&pdev->dev);
	if (!info->data)
		return -ENODEV;

	info->no_irq = true;
	info->data = (struct gpadc_data *)of_dev->data;
	indio_dev->num_channels = ARRAY_SIZE(sun8i_a33_gpadc_channels);
	indio_dev->channels = sun8i_a33_gpadc_channels;

Loading