Re: [PATCH 07/15] iio:adc:ad799x: Only expose event interface when IRQ is available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/04/2014 12:42 AM, Peter Meerwald wrote:
an IRQ is necessary to handle the ALERT condition; without
IRQ, the IIO event interface serves no purpose

Signed-off-by: Peter Meerwald <pmeerw@xxxxxxxxxx>

Makes sense. We should probably at some point investigate if it is possible to implement something to ignore certain channel attributes when the channel is created, rather than having to have two almost identical declarations of the channel arrays.

Acked-by: Lars-Peter Clausen <lars@xxxxxxxxxx>

[...]
@@ -612,8 +702,9 @@ static int ad799x_probe(struct i2c_client *client,
  	i2c_set_clientdata(client, indio_dev);

  	st->id = id->driver_data;
-	st->chip_info = &ad799x_chip_info_tbl[st->id];
-	st->config = st->chip_info->default_config;
+	st->chip_config = (client->irq > 0 && chip_info->irq_config.info) ?
+		&chip_info->irq_config : &chip_info->noirq_config;

Nitpick: should be

	if (...)
		st->chip_config = ...;
	else
		st->chip_config = ...;

+	st->config = st->chip_config->default_config;

  	/* TODO: Add pdata options for filtering and bit delay */

[...]
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux