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

Commit d0c15ad7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull staging / IIO driver fixes from Greg KH:
 "Here are some small staging and IIO driver fixes for 3.15-rc3.

  Nothing major at all, just some assorted issues that people have
  reported"

* tag 'staging-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private data
  iio: adc: mxs-lradc: fix warning when buidling on avr32
  iio: cm36651: Fix i2c client leak and possible NULL pointer dereference
  iio: querying buffer scan_mask should return 0/1
  staging:iio:ad2s1200 fix a missing break
  iio: adc: at91_adc: correct default shtim value
  ARM: at91: at91sam9260: change at91_adc name
  ARM: at91: at91sam9g45: change at91_adc name
  iio: cm32181: Fix read integration time function
  iio: adc: at91_adc: Repair broken platform_data support
parents 005fbcd0 2704f807
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1296,7 +1296,7 @@ static struct resource adc_resources[] = {
};

static struct platform_device at91_adc_device = {
	.name		= "at91_adc",
	.name		= "at91sam9260-adc",
	.id		= -1,
	.dev		= {
				.platform_data		= &adc_data,
+1 −1
Original line number Diff line number Diff line
@@ -1204,7 +1204,7 @@ static struct resource adc_resources[] = {
};

static struct platform_device at91_adc_device = {
	.name		= "at91_adc",
	.name		= "at91sam9g45-adc",
	.id		= -1,
	.dev		= {
				.platform_data	= &adc_data,
+27 −6
Original line number Diff line number Diff line
@@ -765,14 +765,17 @@ static int at91_adc_probe_pdata(struct at91_adc_state *st,
	if (!pdata)
		return -EINVAL;

	st->caps = (struct at91_adc_caps *)
			platform_get_device_id(pdev)->driver_data;

	st->use_external = pdata->use_external_triggers;
	st->vref_mv = pdata->vref;
	st->channels_mask = pdata->channels_used;
	st->num_channels = pdata->num_channels;
	st->num_channels = st->caps->num_channels;
	st->startup_time = pdata->startup_time;
	st->trigger_number = pdata->trigger_number;
	st->trigger_list = pdata->trigger_list;
	st->registers = pdata->registers;
	st->registers = &st->caps->registers;

	return 0;
}
@@ -1004,8 +1007,11 @@ static int at91_adc_probe(struct platform_device *pdev)
	 * the best converted final value between two channels selection
	 * The formula thus is : Sample and Hold Time = (shtim + 1) / ADCClock
	 */
	shtim = round_up((st->sample_hold_time * adc_clk_khz /
			  1000) - 1, 1);
	if (st->sample_hold_time > 0)
		shtim = round_up((st->sample_hold_time * adc_clk_khz / 1000)
				 - 1, 1);
	else
		shtim = 0;

	reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask;
	reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask;
@@ -1101,7 +1107,6 @@ static int at91_adc_remove(struct platform_device *pdev)
	return 0;
}

#ifdef CONFIG_OF
static struct at91_adc_caps at91sam9260_caps = {
	.calc_startup_ticks = calc_startup_ticks_9260,
	.num_channels = 4,
@@ -1154,11 +1159,27 @@ static const struct of_device_id at91_adc_dt_ids[] = {
	{},
};
MODULE_DEVICE_TABLE(of, at91_adc_dt_ids);
#endif

static const struct platform_device_id at91_adc_ids[] = {
	{
		.name = "at91sam9260-adc",
		.driver_data = (unsigned long)&at91sam9260_caps,
	}, {
		.name = "at91sam9g45-adc",
		.driver_data = (unsigned long)&at91sam9g45_caps,
	}, {
		.name = "at91sam9x5-adc",
		.driver_data = (unsigned long)&at91sam9x5_caps,
	}, {
		/* terminator */
	}
};
MODULE_DEVICE_TABLE(platform, at91_adc_ids);

static struct platform_driver at91_adc_driver = {
	.probe = at91_adc_probe,
	.remove = at91_adc_remove,
	.id_table = at91_adc_ids,
	.driver = {
		   .name = DRIVER_NAME,
		   .of_match_table = of_match_ptr(at91_adc_dt_ids),
+4 −2
Original line number Diff line number Diff line
@@ -165,7 +165,8 @@ static ssize_t iio_scan_el_show(struct device *dev,
	int ret;
	struct iio_dev *indio_dev = dev_to_iio_dev(dev);

	ret = test_bit(to_iio_dev_attr(attr)->address,
	/* Ensure ret is 0 or 1. */
	ret = !!test_bit(to_iio_dev_attr(attr)->address,
		       indio_dev->buffer->scan_mask);

	return sprintf(buf, "%d\n", ret);
@@ -862,7 +863,8 @@ int iio_scan_mask_query(struct iio_dev *indio_dev,
	if (!buffer->scan_mask)
		return 0;

	return test_bit(bit, buffer->scan_mask);
	/* Ensure return value is 0 or 1. */
	return !!test_bit(bit, buffer->scan_mask);
};
EXPORT_SYMBOL_GPL(iio_scan_mask_query);

+1 −0
Original line number Diff line number Diff line
@@ -221,6 +221,7 @@ static int cm32181_read_raw(struct iio_dev *indio_dev,
		*val = cm32181->calibscale;
		return IIO_VAL_INT;
	case IIO_CHAN_INFO_INT_TIME:
		*val = 0;
		ret = cm32181_read_als_it(cm32181, val2);
		return ret;
	}
Loading