mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
Merge 5.8-rc6 into staging-next
We need the staging fixes in here, and it resolves a merge issue with an iio driver. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -38,6 +38,11 @@ struct hdc100x_data {
|
||||
|
||||
/* integration time of the sensor */
|
||||
int adc_int_us[2];
|
||||
/* Ensure natural alignment of timestamp */
|
||||
struct {
|
||||
__be16 channels[2];
|
||||
s64 ts __aligned(8);
|
||||
} scan;
|
||||
};
|
||||
|
||||
/* integration time in us */
|
||||
@@ -312,7 +317,6 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p)
|
||||
struct i2c_client *client = data->client;
|
||||
int delay = data->adc_int_us[0] + data->adc_int_us[1];
|
||||
int ret;
|
||||
s16 buf[8]; /* 2x s16 + padding + 8 byte timestamp */
|
||||
|
||||
/* dual read starts at temp register */
|
||||
mutex_lock(&data->lock);
|
||||
@@ -323,13 +327,13 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p)
|
||||
}
|
||||
usleep_range(delay, delay + 1000);
|
||||
|
||||
ret = i2c_master_recv(client, (u8 *)buf, 4);
|
||||
ret = i2c_master_recv(client, (u8 *)data->scan.channels, 4);
|
||||
if (ret < 0) {
|
||||
dev_err(&client->dev, "cannot read sensor data\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
iio_push_to_buffers_with_timestamp(indio_dev, buf,
|
||||
iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
|
||||
iio_get_time_ns(indio_dev));
|
||||
err:
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
|
||||
#include <linux/iio/iio.h>
|
||||
|
||||
#define HTS221_DATA_SIZE 2
|
||||
|
||||
enum hts221_sensor_type {
|
||||
HTS221_SENSOR_H,
|
||||
HTS221_SENSOR_T,
|
||||
@@ -39,6 +37,11 @@ struct hts221_hw {
|
||||
|
||||
bool enabled;
|
||||
u8 odr;
|
||||
/* Ensure natural alignment of timestamp */
|
||||
struct {
|
||||
__le16 channels[2];
|
||||
s64 ts __aligned(8);
|
||||
} scan;
|
||||
};
|
||||
|
||||
extern const struct dev_pm_ops hts221_pm_ops;
|
||||
|
||||
@@ -158,7 +158,6 @@ static const struct iio_buffer_setup_ops hts221_buffer_ops = {
|
||||
|
||||
static irqreturn_t hts221_buffer_handler_thread(int irq, void *p)
|
||||
{
|
||||
u8 buffer[ALIGN(2 * HTS221_DATA_SIZE, sizeof(s64)) + sizeof(s64)];
|
||||
struct iio_poll_func *pf = p;
|
||||
struct iio_dev *iio_dev = pf->indio_dev;
|
||||
struct hts221_hw *hw = iio_priv(iio_dev);
|
||||
@@ -168,18 +167,20 @@ static irqreturn_t hts221_buffer_handler_thread(int irq, void *p)
|
||||
/* humidity data */
|
||||
ch = &iio_dev->channels[HTS221_SENSOR_H];
|
||||
err = regmap_bulk_read(hw->regmap, ch->address,
|
||||
buffer, HTS221_DATA_SIZE);
|
||||
&hw->scan.channels[0],
|
||||
sizeof(hw->scan.channels[0]));
|
||||
if (err < 0)
|
||||
goto out;
|
||||
|
||||
/* temperature data */
|
||||
ch = &iio_dev->channels[HTS221_SENSOR_T];
|
||||
err = regmap_bulk_read(hw->regmap, ch->address,
|
||||
buffer + HTS221_DATA_SIZE, HTS221_DATA_SIZE);
|
||||
&hw->scan.channels[1],
|
||||
sizeof(hw->scan.channels[1]));
|
||||
if (err < 0)
|
||||
goto out;
|
||||
|
||||
iio_push_to_buffers_with_timestamp(iio_dev, buffer,
|
||||
iio_push_to_buffers_with_timestamp(iio_dev, &hw->scan,
|
||||
iio_get_time_ns(iio_dev));
|
||||
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user