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

  The "biggest" thing here is a removal of the fbtft device and flexfb
  code as they have been abandoned by their authors and are no longer
  needed for that hardware.

  Other than that, the usual amount of staging driver and iio driver
  fixes for reported issues, and some speakup sysfs file documentation,
  which has been long awaited for.

  All have been in linux-next with no reported issues"

* tag 'staging-5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (32 commits)
  iio: Fix an undefied reference error in noa1305_probe
  iio: light: opt3001: fix mutex unlock race
  iio: adc: ad799x: fix probe error handling
  iio: light: add missing vcnl4040 of_compatible
  iio: light: fix vcnl4000 devicetree hooks
  iio: imu: st_lsm6dsx: fix waitime for st_lsm6dsx i2c controller
  iio: adc: axp288: Override TS pin bias current for some models
  iio: imu: adis16400: fix memory leak
  iio: imu: adis16400: release allocated memory on failure
  iio: adc: stm32-adc: fix a race when using several adcs with dma and irq
  iio: adc: stm32-adc: move registers definitions
  iio: accel: adxl372: Perform a reset at start up
  iio: accel: adxl372: Fix push to buffers lost samples
  iio: accel: adxl372: Fix/remove limitation for FIFO samples
  iio: adc: hx711: fix bug in sampling of data
  staging: vt6655: Fix memory leak in vt6655_probe
  staging: exfat: Use kvzalloc() instead of kzalloc() for exfat_sb_info
  Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc
  staging: speakup: document sysfs attributes
  staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E()
  ...
parents 82c87e7d 3f3d3162
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -474,12 +474,17 @@ static int adxl372_configure_fifo(struct adxl372_state *st)
	if (ret < 0)
		return ret;

	fifo_samples = st->watermark & 0xFF;
	/*
	 * watermark stores the number of sets; we need to write the FIFO
	 * registers with the number of samples
	 */
	fifo_samples = (st->watermark * st->fifo_set_size);
	fifo_ctl = ADXL372_FIFO_CTL_FORMAT_MODE(st->fifo_format) |
		   ADXL372_FIFO_CTL_MODE_MODE(st->fifo_mode) |
		   ADXL372_FIFO_CTL_SAMPLES_MODE(st->watermark);
		   ADXL372_FIFO_CTL_SAMPLES_MODE(fifo_samples);

	ret = regmap_write(st->regmap, ADXL372_FIFO_SAMPLES, fifo_samples);
	ret = regmap_write(st->regmap,
			   ADXL372_FIFO_SAMPLES, fifo_samples & 0xFF);
	if (ret < 0)
		return ret;

@@ -548,8 +553,7 @@ static irqreturn_t adxl372_trigger_handler(int irq, void *p)
			goto err;

		/* Each sample is 2 bytes */
		for (i = 0; i < fifo_entries * sizeof(u16);
		     i += st->fifo_set_size * sizeof(u16))
		for (i = 0; i < fifo_entries; i += st->fifo_set_size)
			iio_push_to_buffers(indio_dev, &st->fifo_buf[i]);
	}
err:
@@ -571,6 +575,14 @@ static int adxl372_setup(struct adxl372_state *st)
		return -ENODEV;
	}

	/*
	 * Perform a software reset to make sure the device is in a consistent
	 * state after start up.
	 */
	ret = regmap_write(st->regmap, ADXL372_RESET, ADXL372_RESET_CODE);
	if (ret < 0)
		return ret;

	ret = adxl372_set_op_mode(st, ADXL372_STANDBY);
	if (ret < 0)
		return ret;
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@
#define BMC150_ACCEL_SLEEP_1_SEC		0x0F

#define BMC150_ACCEL_REG_TEMP			0x08
#define BMC150_ACCEL_TEMP_CENTER_VAL		24
#define BMC150_ACCEL_TEMP_CENTER_VAL		23

#define BMC150_ACCEL_AXIS_TO_REG(axis)	(BMC150_ACCEL_REG_XOUT_L + (axis * 2))
#define BMC150_AUTO_SUSPEND_DELAY_MS		2000
+2 −2
Original line number Diff line number Diff line
@@ -810,10 +810,10 @@ static int ad799x_probe(struct i2c_client *client,

	ret = ad799x_write_config(st, st->chip_config->default_config);
	if (ret < 0)
		goto error_disable_reg;
		goto error_disable_vref;
	ret = ad799x_read_config(st);
	if (ret < 0)
		goto error_disable_reg;
		goto error_disable_vref;
	st->config = ret;

	ret = iio_triggered_buffer_setup(indio_dev, NULL,
+32 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

#include <linux/dmi.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
@@ -25,6 +26,11 @@
#define AXP288_ADC_EN_MASK				0xF0
#define AXP288_ADC_TS_ENABLE				0x01

#define AXP288_ADC_TS_BIAS_MASK				GENMASK(5, 4)
#define AXP288_ADC_TS_BIAS_20UA				(0 << 4)
#define AXP288_ADC_TS_BIAS_40UA				(1 << 4)
#define AXP288_ADC_TS_BIAS_60UA				(2 << 4)
#define AXP288_ADC_TS_BIAS_80UA				(3 << 4)
#define AXP288_ADC_TS_CURRENT_ON_OFF_MASK		GENMASK(1, 0)
#define AXP288_ADC_TS_CURRENT_OFF			(0 << 0)
#define AXP288_ADC_TS_CURRENT_ON_WHEN_CHARGING		(1 << 0)
@@ -177,10 +183,36 @@ static int axp288_adc_read_raw(struct iio_dev *indio_dev,
	return ret;
}

/*
 * We rely on the machine's firmware to correctly setup the TS pin bias current
 * at boot. This lists systems with broken fw where we need to set it ourselves.
 */
static const struct dmi_system_id axp288_adc_ts_bias_override[] = {
	{
		/* Lenovo Ideapad 100S (11 inch) */
		.matches = {
		  DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
		  DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 100S-11IBY"),
		},
		.driver_data = (void *)(uintptr_t)AXP288_ADC_TS_BIAS_80UA,
	},
	{}
};

static int axp288_adc_initialize(struct axp288_adc_info *info)
{
	const struct dmi_system_id *bias_override;
	int ret, adc_enable_val;

	bias_override = dmi_first_match(axp288_adc_ts_bias_override);
	if (bias_override) {
		ret = regmap_update_bits(info->regmap, AXP288_ADC_TS_PIN_CTRL,
					 AXP288_ADC_TS_BIAS_MASK,
					 (uintptr_t)bias_override->driver_data);
		if (ret)
			return ret;
	}

	/*
	 * Determine if the TS pin is enabled and set the TS current-source
	 * accordingly.
+5 −5
Original line number Diff line number Diff line
@@ -100,14 +100,14 @@ struct hx711_data {

static int hx711_cycle(struct hx711_data *hx711_data)
{
	int val;
	unsigned long flags;

	/*
	 * if preempted for more then 60us while PD_SCK is high:
	 * hx711 is going in reset
	 * ==> measuring is false
	 */
	preempt_disable();
	local_irq_save(flags);
	gpiod_set_value(hx711_data->gpiod_pd_sck, 1);

	/*
@@ -117,7 +117,6 @@ static int hx711_cycle(struct hx711_data *hx711_data)
	 */
	ndelay(hx711_data->data_ready_delay_ns);

	val = gpiod_get_value(hx711_data->gpiod_dout);
	/*
	 * here we are not waiting for 0.2 us as suggested by the datasheet,
	 * because the oscilloscope showed in a test scenario
@@ -125,7 +124,7 @@ static int hx711_cycle(struct hx711_data *hx711_data)
	 * and 0.56 us for PD_SCK low on TI Sitara with 800 MHz
	 */
	gpiod_set_value(hx711_data->gpiod_pd_sck, 0);
	preempt_enable();
	local_irq_restore(flags);

	/*
	 * make it a square wave for addressing cases with capacitance on
@@ -133,7 +132,8 @@ static int hx711_cycle(struct hx711_data *hx711_data)
	 */
	ndelay(hx711_data->data_ready_delay_ns);

	return val;
	/* sample as late as possible */
	return gpiod_get_value(hx711_data->gpiod_dout);
}

static int hx711_read(struct hx711_data *hx711_data)
Loading