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

Commit 1021bb5c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-v3.7a' of...

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

First set of IIO rework and new drivers for 3.7 cycle.

New MXS adc driver form Marek Vasut with a minor addition
to the example code to support 4 byte reads.

First of I suspect many devm conversion patches form Julia Lawall
Some module_platform_driver uses that somehow got missed the
first time around.

Couple of other useful cleanups.
parents c4f9e644 bc2c90c9
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
* Freescale i.MX28 LRADC device driver

Required properties:
- compatible: Should be "fsl,imx28-lradc"
- reg: Address and length of the register set for the device
- interrupts: Should contain the LRADC interrupts

Examples:

	lradc@80050000 {
		compatible = "fsl,imx28-lradc";
		reg = <0x80050000 0x2000>;
		interrupts = <10 14 15 16 17 18 19
				20 21 22 23 24 25>;
	};
+8 −34
Original line number Diff line number Diff line
@@ -545,13 +545,6 @@ static int __devinit at91_adc_probe(struct platform_device *pdev)
		goto error_free_device;
	}

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
		dev_err(&pdev->dev, "No resource defined\n");
		ret = -ENXIO;
		goto error_ret;
	}

	platform_set_drvdata(pdev, idev);

	idev->dev.parent = &pdev->dev;
@@ -566,18 +559,12 @@ static int __devinit at91_adc_probe(struct platform_device *pdev)
		goto error_free_device;
	}

	if (!request_mem_region(res->start, resource_size(res),
				"AT91 adc registers")) {
		dev_err(&pdev->dev, "Resources are unavailable.\n");
		ret = -EBUSY;
		goto error_free_device;
	}
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

	st->reg_base = ioremap(res->start, resource_size(res));
	st->reg_base = devm_request_and_ioremap(&pdev->dev, res);
	if (!st->reg_base) {
		dev_err(&pdev->dev, "Failed to map registers.\n");
		ret = -ENOMEM;
		goto error_release_mem;
		goto error_free_device;
	}

	/*
@@ -592,10 +579,10 @@ static int __devinit at91_adc_probe(struct platform_device *pdev)
			  idev);
	if (ret) {
		dev_err(&pdev->dev, "Failed to allocate IRQ.\n");
		goto error_unmap_reg;
		goto error_free_device;
	}

	st->clk = clk_get(&pdev->dev, "adc_clk");
	st->clk = devm_clk_get(&pdev->dev, "adc_clk");
	if (IS_ERR(st->clk)) {
		dev_err(&pdev->dev, "Failed to get the clock.\n");
		ret = PTR_ERR(st->clk);
@@ -605,7 +592,7 @@ static int __devinit at91_adc_probe(struct platform_device *pdev)
	ret = clk_prepare(st->clk);
	if (ret) {
		dev_err(&pdev->dev, "Could not prepare the clock.\n");
		goto error_free_clk;
		goto error_free_irq;
	}

	ret = clk_enable(st->clk);
@@ -614,7 +601,7 @@ static int __devinit at91_adc_probe(struct platform_device *pdev)
		goto error_unprepare_clk;
	}

	st->adc_clk = clk_get(&pdev->dev, "adc_op_clk");
	st->adc_clk = devm_clk_get(&pdev->dev, "adc_op_clk");
	if (IS_ERR(st->adc_clk)) {
		dev_err(&pdev->dev, "Failed to get the ADC clock.\n");
		ret = PTR_ERR(st->clk);
@@ -624,7 +611,7 @@ static int __devinit at91_adc_probe(struct platform_device *pdev)
	ret = clk_prepare(st->adc_clk);
	if (ret) {
		dev_err(&pdev->dev, "Could not prepare the ADC clock.\n");
		goto error_free_adc_clk;
		goto error_disable_clk;
	}

	ret = clk_enable(st->adc_clk);
@@ -697,20 +684,12 @@ static int __devinit at91_adc_probe(struct platform_device *pdev)
	clk_disable(st->adc_clk);
error_unprepare_adc_clk:
	clk_unprepare(st->adc_clk);
error_free_adc_clk:
	clk_put(st->adc_clk);
error_disable_clk:
	clk_disable(st->clk);
error_unprepare_clk:
	clk_unprepare(st->clk);
error_free_clk:
	clk_put(st->clk);
error_free_irq:
	free_irq(st->irq, idev);
error_unmap_reg:
	iounmap(st->reg_base);
error_release_mem:
	release_mem_region(res->start, resource_size(res));
error_free_device:
	iio_device_free(idev);
error_ret:
@@ -720,20 +699,15 @@ static int __devinit at91_adc_probe(struct platform_device *pdev)
static int __devexit at91_adc_remove(struct platform_device *pdev)
{
	struct iio_dev *idev = platform_get_drvdata(pdev);
	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	struct at91_adc_state *st = iio_priv(idev);

	iio_device_unregister(idev);
	at91_adc_trigger_remove(idev);
	at91_adc_buffer_remove(idev);
	clk_disable_unprepare(st->adc_clk);
	clk_put(st->adc_clk);
	clk_disable(st->clk);
	clk_unprepare(st->clk);
	clk_put(st->clk);
	free_irq(st->irq, idev);
	iounmap(st->reg_base);
	release_mem_region(res->start, resource_size(res));
	iio_device_free(idev);

	return 0;
+10 −0
Original line number Diff line number Diff line
@@ -104,6 +104,16 @@ void process_scan(char *data,
			print2byte(*(uint16_t *)(data + channels[k].location),
				   &channels[k]);
			break;
		case 4:
			if (!channels[k].is_signed) {
				uint32_t val = *(uint32_t *)
					(data + channels[k].location);
				printf("%05f ", ((float)val +
						 channels[k].offset)*
				       channels[k].scale);

			}
			break;
		case 8:
			if (channels[k].is_signed) {
				int64_t val = *(int64_t *)
+1 −1
Original line number Diff line number Diff line
@@ -390,7 +390,7 @@ static int adis16201_write_raw(struct iio_dev *indio_dev,
	return -EINVAL;
}

static struct iio_chan_spec adis16201_channels[] = {
static const struct iio_chan_spec adis16201_channels[] = {
	{
		.type = IIO_VOLTAGE,
		.indexed = 1,
+1 −1
Original line number Diff line number Diff line
@@ -355,7 +355,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
	}
}

static struct iio_chan_spec adis16203_channels[] = {
static const struct iio_chan_spec adis16203_channels[] = {
	{
		.type = IIO_VOLTAGE,
		.indexed = 1,
Loading