0_readable_reg,
> + .writeable_reg = vcnl4000_writeable_reg,
> +};
> +
> static int vcnl4000_probe(struct i2c_client *client,
> const struct i2c_device_id *id)
> {
> @@ -162,7 +269,13 @@ static int vcnl4000_probe(struct i2c_client *client,
> return -ENOMEM;
>
> data = iio_priv(indio_dev);
> + data->regmap = devm_regmap_init_i2c(client, _regmap_config);
> + if (IS_ERR(data->regmap)) {
> + dev_err(>dev, "regmap_init failed!\n");
> + return PTR_ERR(data->regmap);
> + }
> i2c_set_clientdata(client, indio_dev);
> + mutex_init(>lock);
> data->client = client;
>
> ret = i2c_smbus_read_byte_data(data->client, VCNL4000_PROD_REV);
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
able_reg = vcnl4000_writeable_reg,
> +};
> +
> static int vcnl4000_probe(struct i2c_client *client,
> const struct i2c_device_id *id)
> {
> @@ -162,7 +269,13 @@ static int vcnl4000_probe(struct i2c_client *client,
> return -ENOMEM;
>
> data = iio_priv(indio_dev);
> + data->regmap = devm_regmap_init_i2c(client, _regmap_config);
> + if (IS_ERR(data->regmap)) {
> + dev_err(>dev, "regmap_init failed!\n");
> + return PTR_ERR(data->regmap);
> + }
> i2c_set_clientdata(client, indio_dev);
> + mutex_init(>lock);
> data->client = client;
>
> ret = i2c_smbus_read_byte_data(data->client, VCNL4000_PROD_REV);
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
uct ec_params_motion_sense param;
> + struct ec_response_motion_sense *resp;
> +
> + /* Type of sensor */
> + enum motionsensor_type type;
> + enum motionsensor_location loc;
> +
> + /*
> + * Calibration parameters. Note that trigger captured data will always
> + * provide the calibrated values.
> + */
> + struct calib_data {
> + s16 offset;
> + } calib[MAX_AXIS];
> +
> + /*
> + * Static array to hold data from a single capture. For each
> + * channel we need 2 bytes, except for the timestamp. The timestamp
> + * is always last and is always 8-byte aligned.
> + */
> + u8 samples[CROS_EC_SAMPLE_SIZE];
> +
> + /* Pointer to function used for accessing sensors values. */
> + cros_ec_sensors_read_t *read_ec_sensors_data;
> +
> + /* Current sampling period */
> + int curr_sampl_freq;
> +};
> +
> +/* Basic initialization of the core structure. */
> +int cros_ec_sensors_core_init(struct platform_device *pdev,
> + struct iio_dev *indio_dev,
> + bool physical_device);
> +
> +/*
> + * cros_ec_sensors_capture - the trigger handler function
> + *
> + * @irq: the interrupt number
> + * @p: private data - always a pointer to the poll func.
> + *
> + * On a trigger event occurring, if the pollfunc is attached then this
> + * handler is called as a threaded interrupt (and hence may sleep). It
> + * is responsible for grabbing data from the device and pushing it into
> + * the associated buffer.
> + */
> +irqreturn_t cros_ec_sensors_capture(int irq, void *p);
> +
> +
> +/*
> + * cros_ec_motion_send_host_cmd - send motion sense host command
> + *
> + * @st Pointer to state information for device.
> + * @opt_length: optional length: to reduce the response size,
> + *useful on the data path.
> + *Otherwise, the maximal allowed response size is used.
> + * @return 0 if ok, -ve on error.
> + *
> + * Note, when called, the sub-command is assumed to be set in param->cmd.
> + */
> +int cros_ec_motion_send_host_cmd(struct cros_ec_sensors_core_state *st,
> + u16 opt_length);
> +
> +/*
> + * cros_ec_sensors_core_read/write: handler for core attributes.
> + *
> + * Handler for attributes identical among sensors:
> + * - frequency,
> + * - sampling_frequency.
> + *
> + * cmd_lock lock must be held.
> + */
> +int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st,
> + struct iio_chan_spec const *chan,
> + int *val, int *val2, long mask);
> +
> +int cros_ec_sensors_core_write(struct cros_ec_sensors_core_state *st,
> +struct iio_chan_spec const *chan,
> +int val, int val2, long mask);
> +
> +extern const struct dev_pm_ops cros_ec_sensors_pm_ops;
> +
> +/* List of extended channel specification for all sensors */
> +extern const struct iio_chan_spec_ext_info cros_ec_sensors_ext_info[];
> +extern const struct iio_chan_spec_ext_info cros_ec_sensors_limited_info[];
> +
> +#endif /* __CROS_EC_SENSORS_CORE_H */
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
; + /* Type of sensor */
> + enum motionsensor_type type;
> + enum motionsensor_location loc;
> +
> + /*
> + * Calibration parameters. Note that trigger captured data will always
> + * provide the calibrated values.
> + */
> + struct calib_data {
> + s16 offset;
> + } calib[MAX_AXIS];
> +
> + /*
> + * Static array to hold data from a single capture. For each
> + * channel we need 2 bytes, except for the timestamp. The timestamp
> + * is always last and is always 8-byte aligned.
> + */
> + u8 samples[CROS_EC_SAMPLE_SIZE];
> +
> + /* Pointer to function used for accessing sensors values. */
> + cros_ec_sensors_read_t *read_ec_sensors_data;
> +
> + /* Current sampling period */
> + int curr_sampl_freq;
> +};
> +
> +/* Basic initialization of the core structure. */
> +int cros_ec_sensors_core_init(struct platform_device *pdev,
> + struct iio_dev *indio_dev,
> + bool physical_device);
> +
> +/*
> + * cros_ec_sensors_capture - the trigger handler function
> + *
> + * @irq: the interrupt number
> + * @p: private data - always a pointer to the poll func.
> + *
> + * On a trigger event occurring, if the pollfunc is attached then this
> + * handler is called as a threaded interrupt (and hence may sleep). It
> + * is responsible for grabbing data from the device and pushing it into
> + * the associated buffer.
> + */
> +irqreturn_t cros_ec_sensors_capture(int irq, void *p);
> +
> +
> +/*
> + * cros_ec_motion_send_host_cmd - send motion sense host command
> + *
> + * @st Pointer to state information for device.
> + * @opt_length: optional length: to reduce the response size,
> + *useful on the data path.
> + *Otherwise, the maximal allowed response size is used.
> + * @return 0 if ok, -ve on error.
> + *
> + * Note, when called, the sub-command is assumed to be set in param->cmd.
> + */
> +int cros_ec_motion_send_host_cmd(struct cros_ec_sensors_core_state *st,
> + u16 opt_length);
> +
> +/*
> + * cros_ec_sensors_core_read/write: handler for core attributes.
> + *
> + * Handler for attributes identical among sensors:
> + * - frequency,
> + * - sampling_frequency.
> + *
> + * cmd_lock lock must be held.
> + */
> +int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st,
> + struct iio_chan_spec const *chan,
> + int *val, int *val2, long mask);
> +
> +int cros_ec_sensors_core_write(struct cros_ec_sensors_core_state *st,
> +struct iio_chan_spec const *chan,
> +int val, int val2, long mask);
> +
> +extern const struct dev_pm_ops cros_ec_sensors_pm_ops;
> +
> +/* List of extended channel specification for all sensors */
> +extern const struct iio_chan_spec_ext_info cros_ec_sensors_ext_info[];
> +extern const struct iio_chan_spec_ext_info cros_ec_sensors_limited_info[];
> +
> +#endif /* __CROS_EC_SENSORS_CORE_H */
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
return -EBUSY;
> + }
> +
> + indio_dev->info = _dac_info;
> + indio_dev->modes = INDIO_DIRECT_MODE;
> + indio_dev->channels = cio_dac_channels;
> + indio_dev->num_channels = CIO_DAC_NUM_CHAN;
> + indio_dev->name = dev_name(dev);
> +
> + priv = iio_priv(indio_dev);
> + priv->base = base[id];
> +
> + /* initialize DAC outputs to 0V */
> + for (i = 0; i < 32; i += 2)
> + outw(0, base[id] + i);
> +
> + return devm_iio_device_register(dev, indio_dev);
> +}
> +
> +static struct isa_driver cio_dac_driver = {
> + .probe = cio_dac_probe,
> + .driver = {
> + .name = "cio-dac"
> + }
> +};
> +
> +module_isa_driver(cio_dac_driver, num_cio_dac);
> +
> +MODULE_AUTHOR("William Breathitt Gray <vilhelm.g...@gmail.com>");
> +MODULE_DESCRIPTION("Measurement Computing CIO-DAC DAC driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
> + indio_dev->channels = cio_dac_channels;
> + indio_dev->num_channels = CIO_DAC_NUM_CHAN;
> + indio_dev->name = dev_name(dev);
> +
> + priv = iio_priv(indio_dev);
> + priv->base = base[id];
> +
> + /* initialize DAC outputs to 0V */
> + for (i = 0; i < 32; i += 2)
> + outw(0, base[id] + i);
> +
> + return devm_iio_device_register(dev, indio_dev);
> +}
> +
> +static struct isa_driver cio_dac_driver = {
> + .probe = cio_dac_probe,
> + .driver = {
> + .name = "cio-dac"
> + }
> +};
> +
> +module_isa_driver(cio_dac_driver, num_cio_dac);
> +
> +MODULE_AUTHOR("William Breathitt Gray ");
> +MODULE_DESCRIPTION("Measurement Computing CIO-DAC DAC driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
p4725_probe(struct i2c_client *client,
> return err;
> }
> pd = (inbuf[0] >> 1) & 0x3;
> - data->powerdown = pd > 0 ? true : false;
> + data->powerdown = pd > 0;
> data->powerdown_mode = pd ? pd - 1 : 2; /* largest reg
e(struct i2c_client *client,
> return err;
> }
> pd = (inbuf[0] >> 1) & 0x3;
> - data->powerdown = pd > 0 ? true : false;
> + data->powerdown = pd > 0;
> data->powerdown_mode = pd ? pd - 1 : 2; /* largest register to gnd */
&g
NGE_1)
> > data->conf1 |= ISL29125_MODE_RANGE;
> > - else if (val2 == 5722)
> > + else if (val2 == SENSING_RANGE_0)
> > data->conf1 &= ~ISL29125_MODE_RANGE;
> > else
> > return -EINVAL;
> >
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
NGE_1)
> > data->conf1 |= ISL29125_MODE_RANGE;
> > - else if (val2 == 5722)
> > + else if (val2 == SENSING_RANGE_0)
> > data->conf1 &= ~ISL29125_MODE_RANGE;
> > else
> > return -EINVAL;
> >
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
makes sure that the I2C communication
> happens atomically.
>
> > +if (err == 2) {
> > +*reg_val = rx_buf[0];
> > +*reg_val = *reg_val << 8;
> > +*reg_val = *reg_val | rx_buf[1];
> > +}
> > +return err;
> > +} else {
> > +return -EINVAL;
> > +}
> > +}
> [...]
> > +
> > +static irqreturn_t alert_isr(int irq, void *dev_id) {
> > +dev_warn(dev_id, "Temperature outside of limits!");
>
> Please use IIO threshold events for this. Such out-of-band communication is
> really not acceptable.
>
> > +return IRQ_HANDLED;
> > +}
> > +
> > +static int setupIRQ(struct iio_dev *indio_dev, bool set_gpio, u8 pol)
> > +{ int err; struct as6200_data *data = iio_priv(indio_dev); struct
> > +device *dev = >client->dev; int gpio = -1; int irq_num; int
> > +irq_trig;
> > +
> > +if (pol == 1)
> > +irq_trig = IRQF_TRIGGER_RISING;
> > +else
> > +irq_trig = IRQF_TRIGGER_FALLING;
> > +
> > +if (set_gpio) {
> > +gpio = of_get_named_gpio_flags(dev->of_node,
> > +"as6200,irq-gpio", 0, 0);
> > +err = gpio_request(gpio, "as6200_irq"); if (err) { dev_info(dev, "%s:
> > +requesting gpio %d failed\n", as6200_id[0].name, gpio); return err; }
> > +err = gpio_direction_input(gpio); if (err) { dev_info(dev, "%s: gpio
> > +%d cannot apply direction\n", as6200_id[0].name, gpio); return err; }
> > +} irq_num = gpio_to_irq(gpio); dev_info(dev, "%s: registering for IRQ
> > +%d\n", as6200_id[0].name, irq_num);
>
> Please drop all these dev_info(). That's just noise in the boot log, imagine
> every driver did this you wouldn't be able to spot the critical information.
>
> > +err = request_irq(irq_num, alert_isr, irq_trig, as6200_id[0].name,
> > +dev);
>
> Don't do all the GPIO translation. This pin is only used as a interrupt, so
> specify it directly as an interrupt and use it that way as well.
>
> > +if (err) {
> > +dev_info(dev, "%s: error requesting irq %d\n", as6200_id[0].name,
> > +err);
>
> For errors use dev_err. Also the as6200_id[0].name is redundant since
> dev_info/dev_err already prefixes the message with the device name.
>
> > +return err;
> > +}
> > +dev_info(dev, "%s: registered for IRQ %d\n", as6200_id[0].name,
> > +irq_num); mutex_lock(>update_lock);
> > +data->irqn = irq_num;
> > +mutex_unlock(>update_lock);
>
> What exactly is protect by that mutex here?
>
> > +
> > +return 0;
> > +}
> > +
> [...]
> > +if (err == 0) {
> > +if ((val < -40) | (val > 150)) {
> > +dev_info(>dev,
> > +"Value for THIGH is invalid min = -40%cC, max = 150°C, val = %d°C",
> > +(unsigned char)(248), val);
>
> Please no out-of-band error reporting.
>
> > +return count;
> > +}
> > +val = (val * 1) / 625;
> > +reg_val = val << 4;
> [...]
> > +static int as6200_probe(struct i2c_client *client, const struct
> > +i2c_device_id *id) { struct iio_dev *indio_dev = NULL; struct
> > +as6200_data *data = NULL;
>
> No need to initialize those here with dummy, this will just hide warnings in
> case you forgot to initialize them with actual data.
>
> > +
> > +indio_dev = devm_iio_device_alloc(>dev, sizeof(*data));
> > +
> > +if (!indio_dev)
> > +return -ENOMEM;
> > +
> > +data = iio_priv(indio_dev);
> > +i2c_set_clientdata(client, indio_dev);
> > +data->client = client;
> > +
> > +indio_dev->dev.parent = >dev; indio_dev->name =
> > +dev_name(>dev);
>
> use id->name for this. dev_name() contains things like the I2C bus and device
> address, etc. Whereas the IIO device name should describe the type of device.
>
> > +indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = _info;
> > +
> > +indio_dev->channels = as6200_channels; indio_dev->num_channels =
> > +ARRAY_SIZE(as6200_channels);
> > +
> > +initClientData(data);
> > +mutex_init(>update_lock);
> > +setupIRQ(indio_dev, true, 0);
> > +
> > +return iio_device_register(indio_dev);
>
> Error handling is missing here, you need to free the resources that were
> acquired in case of an error.
>
> > +}
> > +
> [...]
>
>
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
gt; i2c_smbus_read_word_swapped() which makes sure that the I2C communication
> happens atomically.
>
> > +if (err == 2) {
> > +*reg_val = rx_buf[0];
> > +*reg_val = *reg_val << 8;
> > +*reg_val = *reg_val | rx_buf[1];
> > +}
> > +return err;
> > +} else {
> > +return -EINVAL;
> > +}
> > +}
> [...]
> > +
> > +static irqreturn_t alert_isr(int irq, void *dev_id) {
> > +dev_warn(dev_id, "Temperature outside of limits!");
>
> Please use IIO threshold events for this. Such out-of-band communication is
> really not acceptable.
>
> > +return IRQ_HANDLED;
> > +}
> > +
> > +static int setupIRQ(struct iio_dev *indio_dev, bool set_gpio, u8 pol)
> > +{ int err; struct as6200_data *data = iio_priv(indio_dev); struct
> > +device *dev = >client->dev; int gpio = -1; int irq_num; int
> > +irq_trig;
> > +
> > +if (pol == 1)
> > +irq_trig = IRQF_TRIGGER_RISING;
> > +else
> > +irq_trig = IRQF_TRIGGER_FALLING;
> > +
> > +if (set_gpio) {
> > +gpio = of_get_named_gpio_flags(dev->of_node,
> > +"as6200,irq-gpio", 0, 0);
> > +err = gpio_request(gpio, "as6200_irq"); if (err) { dev_info(dev, "%s:
> > +requesting gpio %d failed\n", as6200_id[0].name, gpio); return err; }
> > +err = gpio_direction_input(gpio); if (err) { dev_info(dev, "%s: gpio
> > +%d cannot apply direction\n", as6200_id[0].name, gpio); return err; }
> > +} irq_num = gpio_to_irq(gpio); dev_info(dev, "%s: registering for IRQ
> > +%d\n", as6200_id[0].name, irq_num);
>
> Please drop all these dev_info(). That's just noise in the boot log, imagine
> every driver did this you wouldn't be able to spot the critical information.
>
> > +err = request_irq(irq_num, alert_isr, irq_trig, as6200_id[0].name,
> > +dev);
>
> Don't do all the GPIO translation. This pin is only used as a interrupt, so
> specify it directly as an interrupt and use it that way as well.
>
> > +if (err) {
> > +dev_info(dev, "%s: error requesting irq %d\n", as6200_id[0].name,
> > +err);
>
> For errors use dev_err. Also the as6200_id[0].name is redundant since
> dev_info/dev_err already prefixes the message with the device name.
>
> > +return err;
> > +}
> > +dev_info(dev, "%s: registered for IRQ %d\n", as6200_id[0].name,
> > +irq_num); mutex_lock(>update_lock);
> > +data->irqn = irq_num;
> > +mutex_unlock(>update_lock);
>
> What exactly is protect by that mutex here?
>
> > +
> > +return 0;
> > +}
> > +
> [...]
> > +if (err == 0) {
> > +if ((val < -40) | (val > 150)) {
> > +dev_info(>dev,
> > +"Value for THIGH is invalid min = -40%cC, max = 150°C, val = %d°C",
> > +(unsigned char)(248), val);
>
> Please no out-of-band error reporting.
>
> > +return count;
> > +}
> > +val = (val * 1) / 625;
> > +reg_val = val << 4;
> [...]
> > +static int as6200_probe(struct i2c_client *client, const struct
> > +i2c_device_id *id) { struct iio_dev *indio_dev = NULL; struct
> > +as6200_data *data = NULL;
>
> No need to initialize those here with dummy, this will just hide warnings in
> case you forgot to initialize them with actual data.
>
> > +
> > +indio_dev = devm_iio_device_alloc(>dev, sizeof(*data));
> > +
> > +if (!indio_dev)
> > +return -ENOMEM;
> > +
> > +data = iio_priv(indio_dev);
> > +i2c_set_clientdata(client, indio_dev);
> > +data->client = client;
> > +
> > +indio_dev->dev.parent = >dev; indio_dev->name =
> > +dev_name(>dev);
>
> use id->name for this. dev_name() contains things like the I2C bus and device
> address, etc. Whereas the IIO device name should describe the type of device.
>
> > +indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = _info;
> > +
> > +indio_dev->channels = as6200_channels; indio_dev->num_channels =
> > +ARRAY_SIZE(as6200_channels);
> > +
> > +initClientData(data);
> > +mutex_init(>update_lock);
> > +setupIRQ(indio_dev, true, 0);
> > +
> > +return iio_device_register(indio_dev);
>
> Error handling is missing here, you need to free the resources that were
> acquired in case of an error.
>
> > +}
> > +
> [...]
>
>
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
On Mon, 6 Jun 2016, Alison Schofield wrote:
> Replace the code that guarantees the device stays in direct mode
> with iio_device_claim_direct_mode() which does same. This allows
> removal of an unused lock in the device private global data.
Acked-by: Peter Meerwald-Stadler <pme..
On Mon, 6 Jun 2016, Alison Schofield wrote:
> Replace the code that guarantees the device stays in direct mode
> with iio_device_claim_direct_mode() which does same. This allows
> removal of an unused lock in the device private global data.
Acked-by: Peter Meerwald-Stadler
>
> Replace the code that guarantees the device stays in direct mode
> with iio_device_claim_direct_mode() which does same. This allows
> removal of an unused lock in the device private global data.
nice!
Acked-by: Peter Meerwald-Stadler <pme...@pmeerw.net>
> Signed-off-by
> Replace the code that guarantees the device stays in direct mode
> with iio_device_claim_direct_mode() which does same. This allows
> removal of an unused lock in the device private global data.
nice!
Acked-by: Peter Meerwald-Stadler
> Signed-off-by: Alison Schofield
> Cc
> Replace the code that guarantees the device stays in direct mode
> with iio_device_claim_direct_mode() which does same. This allows
> removal of an unused lock in the device private global data.
Acked-by: Peter Meerwald-Stadler <pme...@pmeerw.net>
> Signed-off-by: Alison
> Replace the code that guarantees the device stays in direct mode
> with iio_device_claim_direct_mode() which does same. This allows
> removal of an unused lock in the device private global data.
Acked-by: Peter Meerwald-Stadler
> Signed-off-by: Alison Schofield
> Cc
+ ret = i2c_smbus_write_word_data(chip->client,
> + CM36672_ADDR_PRX_CONF,
> + chip->regs[CM36672_ADDR_PRX_CONF]);
> + if (ret) {
> + dev_err(>dev,
> + "%s: enable interrupt failed\n",
> + __func__);
> + return ret;
> + }
> + }
> + }
> +
> + ret = iio_device_register(indio_dev);
> + if (ret) {
> + dev_err(>dev,
> + "%s: regist device failed\n",
registering
> + __func__);
> + if (client->irq)
> + free_irq(client->irq, indio_dev);
> + }
> +
> + return 0;
> +}
> +
> +static int cm36672_remove(struct i2c_client *client)
> +{
> + struct iio_dev *indio_dev = i2c_get_clientdata(client);
> + struct cm36672_chip *chip = iio_priv(indio_dev);
> +
> + i2c_smbus_write_word_data(
> + chip->client,
> + CM36672_ADDR_PRX_CONF,
> + CM36672_PRX_DISABLE);
> + if (client->irq)
> + free_irq(client->irq, indio_dev);
> + iio_device_unregister(indio_dev);
> + return 0;
> +}
> +
> +static const struct i2c_device_id cm36672_id[] = {
> + { "cm36672", 0 },
> + { }
> +};
> +
> +MODULE_DEVICE_TABLE(i2c, cm36672_id);
> +
> +static const struct of_device_id cm36672_of_match[] = {
> + { .compatible = "capella,cm36672" },
> + { }
> +};
> +
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id cm36672_acpi_match[] = {
> + { "CPLM6672", 0},
> + {},
> +};
> +
> +MODULE_DEVICE_TABLE(acpi, cm36672_acpi_match);
> +#endif
> +
> +#ifdef CONFIG_PM_SLEEP
> +static int cm36672_suspend(struct device *dev)
> +{
> + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
> + struct cm36672_chip *chip = iio_priv(indio_dev);
> + int ret;
> +
> + chip->regs[CM36672_ADDR_PRX_CONF] |= CM36672_PRX_DISABLE;
> + ret = i2c_smbus_write_byte_data(
> + chip->client,
> + CM36672_ADDR_PRX_CONF,
> + chip->regs[CM36672_ADDR_PRX_CONF]);
> + return ret;
> +}
> +
> +static int cm36672_resume(struct device *dev)
> +{
> + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
> + struct cm36672_chip *chip = iio_priv(indio_dev);
> + int i, ret;
> +
> + chip->regs[CM36672_ADDR_PRX_CONF] &= ~CM36672_PRX_DISABLE;
> +
> + /* Initialize registers*/
whitespace before */ please
> + for (i = 0; i < CM36672_REGS_NUM; i++) {
> + ret = i2c_smbus_write_word_data(
> + chip->client,
> + i,
> + chip->regs[i]);
> + if (ret < 0)
> + return ret;
> + }
> +
> + return ret;
> +}
> +
> +static const struct dev_pm_ops cm36672_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(cm36672_suspend, cm36672_resume)};
> +#endif
> +
> +static struct i2c_driver cm36672_driver = {
> + .driver = {
> + .name = CM36672_DRIVER_NAME,
> + .of_match_table = cm36672_of_match,
> +#ifdef CONFIG_ACPI
> + .acpi_match_table = ACPI_PTR(cm36672_acpi_match),
> +#endif
> + .owner = THIS_MODULE,
> +#ifdef CONFIG_PM_SLEEP
> + .pm = _pm_ops,
> +#endif
> + },
> + .id_table = cm36672_id,
> + .probe = cm36672_probe,
> + .remove = cm36672_remove,
> +};
> +
> +module_i2c_driver(cm36672_driver);
> +
> +MODULE_AUTHOR("Kevin Tsai <capellami...@gmail.com>");
> +MODULE_DESCRIPTION("CM36672 proximity sensor driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
chip->regs[CM36672_ADDR_PRX_CONF]);
> + if (ret) {
> + dev_err(>dev,
> + "%s: enable interrupt failed\n",
> + __func__);
> + return ret;
> + }
> + }
> + }
> +
> + ret = iio_device_register(indio_dev);
> + if (ret) {
> + dev_err(>dev,
> + "%s: regist device failed\n",
registering
> + __func__);
> + if (client->irq)
> + free_irq(client->irq, indio_dev);
> + }
> +
> + return 0;
> +}
> +
> +static int cm36672_remove(struct i2c_client *client)
> +{
> + struct iio_dev *indio_dev = i2c_get_clientdata(client);
> + struct cm36672_chip *chip = iio_priv(indio_dev);
> +
> + i2c_smbus_write_word_data(
> + chip->client,
> + CM36672_ADDR_PRX_CONF,
> + CM36672_PRX_DISABLE);
> + if (client->irq)
> + free_irq(client->irq, indio_dev);
> + iio_device_unregister(indio_dev);
> + return 0;
> +}
> +
> +static const struct i2c_device_id cm36672_id[] = {
> + { "cm36672", 0 },
> + { }
> +};
> +
> +MODULE_DEVICE_TABLE(i2c, cm36672_id);
> +
> +static const struct of_device_id cm36672_of_match[] = {
> + { .compatible = "capella,cm36672" },
> + { }
> +};
> +
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id cm36672_acpi_match[] = {
> + { "CPLM6672", 0},
> + {},
> +};
> +
> +MODULE_DEVICE_TABLE(acpi, cm36672_acpi_match);
> +#endif
> +
> +#ifdef CONFIG_PM_SLEEP
> +static int cm36672_suspend(struct device *dev)
> +{
> + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
> + struct cm36672_chip *chip = iio_priv(indio_dev);
> + int ret;
> +
> + chip->regs[CM36672_ADDR_PRX_CONF] |= CM36672_PRX_DISABLE;
> + ret = i2c_smbus_write_byte_data(
> + chip->client,
> + CM36672_ADDR_PRX_CONF,
> + chip->regs[CM36672_ADDR_PRX_CONF]);
> + return ret;
> +}
> +
> +static int cm36672_resume(struct device *dev)
> +{
> + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
> + struct cm36672_chip *chip = iio_priv(indio_dev);
> + int i, ret;
> +
> + chip->regs[CM36672_ADDR_PRX_CONF] &= ~CM36672_PRX_DISABLE;
> +
> + /* Initialize registers*/
whitespace before */ please
> + for (i = 0; i < CM36672_REGS_NUM; i++) {
> + ret = i2c_smbus_write_word_data(
> + chip->client,
> + i,
> + chip->regs[i]);
> + if (ret < 0)
> + return ret;
> + }
> +
> + return ret;
> +}
> +
> +static const struct dev_pm_ops cm36672_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(cm36672_suspend, cm36672_resume)};
> +#endif
> +
> +static struct i2c_driver cm36672_driver = {
> + .driver = {
> + .name = CM36672_DRIVER_NAME,
> + .of_match_table = cm36672_of_match,
> +#ifdef CONFIG_ACPI
> + .acpi_match_table = ACPI_PTR(cm36672_acpi_match),
> +#endif
> + .owner = THIS_MODULE,
> +#ifdef CONFIG_PM_SLEEP
> + .pm = _pm_ops,
> +#endif
> + },
> + .id_table = cm36672_id,
> + .probe = cm36672_probe,
> + .remove = cm36672_remove,
> +};
> +
> +module_i2c_driver(cm36672_driver);
> +
> +MODULE_AUTHOR("Kevin Tsai ");
> +MODULE_DESCRIPTION("CM36672 proximity sensor driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
hannels);
> }
>
> - /* Stop the buffer */
> - ret = write_sysfs_int("enable", buf_dir_name, 0);
> - if (ret < 0)
> - goto error_close_buffer_access;
> -
> - if (!notrigger)
> - /* Disconnect the trigger - just write a dummy name. */
> - ret = write_sysfs_string("trigger/current_trigger",
> - dev_dir_name, "NULL");
> - if (ret < 0)
> - fprintf(stderr, "Failed to write to %s\n",
> - dev_dir_name);
> -
> -error_close_buffer_access:
> - if (close(fp) == -1)
> - perror("Failed to close buffer");
> -
> -error_free_buffer_access:
> - free(buffer_access);
> -error_free_data:
> - free(data);
> -error_free_buf_dir_name:
> - free(buf_dir_name);
> -error_free_channels:
> - for (i = num_channels - 1; i >= 0; i--) {
> - free(channels[i].name);
> - free(channels[i].generic_name);
> - }
> - free(channels);
> -error_free_triggername:
> - if (datardytrigger)
> - free(trigger_name);
> -error_disable_channels:
> - if (autochannels == AUTOCHANNELS_ACTIVE) {
> - ret = enable_disable_all_channels(dev_dir_name, 0);
> - if (ret)
> - fprintf(stderr, "Failed to disable all channels\n");
> - }
> -error_free_dev_dir_name:
> - free(dev_dir_name);
> -
> - return ret;
> + return 0;
> }
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
hannels);
> }
>
> - /* Stop the buffer */
> - ret = write_sysfs_int("enable", buf_dir_name, 0);
> - if (ret < 0)
> - goto error_close_buffer_access;
> -
> - if (!notrigger)
> - /* Disconnect the trigger - just write a dummy name. */
> - ret = write_sysfs_string("trigger/current_trigger",
> - dev_dir_name, "NULL");
> - if (ret < 0)
> - fprintf(stderr, "Failed to write to %s\n",
> - dev_dir_name);
> -
> -error_close_buffer_access:
> - if (close(fp) == -1)
> - perror("Failed to close buffer");
> -
> -error_free_buffer_access:
> - free(buffer_access);
> -error_free_data:
> - free(data);
> -error_free_buf_dir_name:
> - free(buf_dir_name);
> -error_free_channels:
> - for (i = num_channels - 1; i >= 0; i--) {
> - free(channels[i].name);
> - free(channels[i].generic_name);
> - }
> - free(channels);
> -error_free_triggername:
> - if (datardytrigger)
> - free(trigger_name);
> -error_disable_channels:
> - if (autochannels == AUTOCHANNELS_ACTIVE) {
> - ret = enable_disable_all_channels(dev_dir_name, 0);
> - if (ret)
> - fprintf(stderr, "Failed to disable all channels\n");
> - }
> -error_free_dev_dir_name:
> - free(dev_dir_name);
> -
> - return ret;
> + return 0;
> }
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
From: Peter Meerwald <pme...@pmeerw.net>
The si114x supports x=1,2,3 IR LEDs for proximity sensing together with
visible and IR ambient light sensing (ALS).
Newer parts (si1132, si1145/6/7) can measure UV light and compute an UV index
Arranging 3 IR LEDs in a triangular shape can b
From: Peter Meerwald
The si114x supports x=1,2,3 IR LEDs for proximity sensing together with
visible and IR ambient light sensing (ALS).
Newer parts (si1132, si1145/6/7) can measure UV light and compute an UV index
Arranging 3 IR LEDs in a triangular shape can be used for detection of swipe
; +MODULE_DEVICE_TABLE(spi, max5487_id);
> +
> +static const struct acpi_device_id max5487_acpi_match[] = {
> + { "MAX5487", 10 },
> + { "MAX5488", 50 },
> + { "MAX5489", 100 },
> + { },
> +};
> +MODULE_DEVICE_TABLE(acpi, max5487_acpi_match);
> +
> +static struct spi_driver max5487_driver = {
> + .driver = {
> + .name = "max5487",
> + .owner = THIS_MODULE,
> + .acpi_match_table = ACPI_PTR(max5487_acpi_match),
> + },
> + .id_table = max5487_id,
> + .probe = max5487_spi_probe,
> + .remove = max5487_spi_remove
> +};
> +module_spi_driver(max5487_driver);
> +
> +MODULE_AUTHOR("Cristina-Gabriela Moraru <cristina.morar...@gmail.com>");
> +MODULE_DESCRIPTION("max5487 SPI driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
tatic const struct spi_device_id max5487_id[] = {
> + { "MAX5487", 10 },
> + { "MAX5488", 50 },
> + { "MAX5489", 100 },
> + { }
> +};
> +MODULE_DEVICE_TABLE(spi, max5487_id);
> +
> +static const struct acpi_device_id max5487_acpi_match[] = {
> + { "MAX5487", 10 },
> + { "MAX5488", 50 },
> + { "MAX5489", 100 },
> + { },
> +};
> +MODULE_DEVICE_TABLE(acpi, max5487_acpi_match);
> +
> +static struct spi_driver max5487_driver = {
> + .driver = {
> + .name = "max5487",
> + .owner = THIS_MODULE,
> + .acpi_match_table = ACPI_PTR(max5487_acpi_match),
> + },
> + .id_table = max5487_id,
> + .probe = max5487_spi_probe,
> + .remove = max5487_spi_remove
> +};
> +module_spi_driver(max5487_driver);
> +
> +MODULE_AUTHOR("Cristina-Gabriela Moraru ");
> +MODULE_DESCRIPTION("max5487 SPI driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
tch(fd, i)); // 0
printf("add %d\n", j=inotify_add_watch(fd, "/tmp/foo", IN_MODIFY)); // 2
return 0;
}
Ubuntu kernel x86_64 4.4.0-21, seems to work here
so we have to guess what's going on between _add and _rm?
regards, p.
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
tch(fd, i)); // 0
printf("add %d\n", j=inotify_add_watch(fd, "/tmp/foo", IN_MODIFY)); // 2
return 0;
}
Ubuntu kernel x86_64 4.4.0-21, seems to work here
so we have to guess what's going on between _add and _rm?
regards, p.
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
to_i2c_client(dev)));
> +
> + return mma7660_set_mode(data, MMA7660_MODE_STANDBY);
> +}
> +
> +static int mma7660_resume(struct device *dev)
> +{
> + struct mma7660_data *data;
> +
> + data = iio_priv(i2c_get_clientdata(to_i2c_client(dev)));
> +
> + return mma7660_set_mode(data, MMA7660_MODE_ACTIVE);
> +}
> +
> +static SIMPLE_DEV_PM_OPS(mma7660_pm_ops, mma7660_suspend, mma7660_resume);
> +
> +#define MMA7660_PM_OPS (_pm_ops)
> +#else
> +#define MMA7660_PM_OPS NULL
> +#endif
> +
> +static const struct i2c_device_id mma7660_i2c_id[] = {
> + {"MMA7660", 0},
really uppercase?
> + {}
> +};
> +
> +static const struct acpi_device_id mma7660_acpi_id[] = {
> + {"MMA7660", 0},
> + {}
> +};
> +
> +MODULE_DEVICE_TABLE(acpi, mma7660_acpi_id);
> +
> +static struct i2c_driver mma7660_driver = {
> + .driver = {
> + .name = "mma7660",
> + .pm = MMA7660_PM_OPS,
> + .acpi_match_table = ACPI_PTR(mma7660_acpi_id),
> + },
> + .probe = mma7660_probe,
> + .remove = mma7660_remove,
> + .id_table = mma7660_i2c_id,
> +};
> +
> +module_i2c_driver(mma7660_driver);
> +
> +MODULE_AUTHOR("Constantin Musca <constantin.mu...@intel.com>");
> +MODULE_DESCRIPTION("Freescale MMA7660FC 3-Axis Accelerometer driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
> + return mma7660_set_mode(data, MMA7660_MODE_STANDBY);
> +}
> +
> +static int mma7660_resume(struct device *dev)
> +{
> + struct mma7660_data *data;
> +
> + data = iio_priv(i2c_get_clientdata(to_i2c_client(dev)));
> +
> + return mma7660_set_mode(data, MMA7660_MODE_ACTIVE);
> +}
> +
> +static SIMPLE_DEV_PM_OPS(mma7660_pm_ops, mma7660_suspend, mma7660_resume);
> +
> +#define MMA7660_PM_OPS (_pm_ops)
> +#else
> +#define MMA7660_PM_OPS NULL
> +#endif
> +
> +static const struct i2c_device_id mma7660_i2c_id[] = {
> + {"MMA7660", 0},
really uppercase?
> + {}
> +};
> +
> +static const struct acpi_device_id mma7660_acpi_id[] = {
> + {"MMA7660", 0},
> + {}
> +};
> +
> +MODULE_DEVICE_TABLE(acpi, mma7660_acpi_id);
> +
> +static struct i2c_driver mma7660_driver = {
> + .driver = {
> + .name = "mma7660",
> + .pm = MMA7660_PM_OPS,
> + .acpi_match_table = ACPI_PTR(mma7660_acpi_id),
> + },
> + .probe = mma7660_probe,
> + .remove = mma7660_remove,
> + .id_table = mma7660_i2c_id,
> +};
> +
> +module_i2c_driver(mma7660_driver);
> +
> +MODULE_AUTHOR("Constantin Musca ");
> +MODULE_DESCRIPTION("Freescale MMA7660FC 3-Axis Accelerometer driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
dev->name = dev_name(>dev);
./humidity/si7005.c:indio_dev->name = dev_name(>dev);
./humidity/hdc100x.c: indio_dev->name = dev_name(>dev);
./humidity/si7020.c:indio_dev->name = dev_name(>dev);
regards, p.
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
dev->name = dev_name(>dev);
./humidity/si7005.c:indio_dev->name = dev_name(>dev);
./humidity/hdc100x.c: indio_dev->name = dev_name(>dev);
./humidity/si7020.c:indio_dev->name = dev_name(>dev);
regards, p.
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
rite_raw_get_fmt
>
> At this point I do not know why should I do it, but I will look into that.
write_raw expects a VAL_INT_PLUS_MICROS per default, passed
in val and val2
you can change that with .write_raw_get_fmt (e.g. to expect VAL_INT),
or just make sure that the micros are 0
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
rite_raw_get_fmt
>
> At this point I do not know why should I do it, but I will look into that.
write_raw expects a VAL_INT_PLUS_MICROS per default, passed
in val and val2
you can change that with .write_raw_get_fmt (e.g. to expect VAL_INT),
or just make sure that the micros are 0
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
> {
> @@ -513,6 +569,12 @@ static int max44000_probe(struct i2c_client *client,
> return ret;
> }
>
> + ret = iio_triggered_buffer_setup(indio_dev, NULL,
> max44000_trigger_handler, NULL);
> + if (ret < 0) {
> + dev_err(>d
@ -513,6 +569,12 @@ static int max44000_probe(struct i2c_client *client,
> return ret;
> }
>
> + ret = iio_triggered_buffer_setup(indio_dev, NULL,
> max44000_trigger_handler, NULL);
> + if (ret < 0) {
> + dev_err(>dev, "iio triggered buffer
ve obsolete
> +}
> +
> +static int max44000_remove(struct i2c_client *client)
> +{
> + struct iio_dev *indio_dev = i2c_get_clientdata(client);
> +
> + iio_device_unregister(indio_dev);
> + return 0;
> +}
> +
> +static const struct i2c_device_id max44000_id[] = {
>
+static int max44000_remove(struct i2c_client *client)
> +{
> + struct iio_dev *indio_dev = i2c_get_clientdata(client);
> +
> + iio_device_unregister(indio_dev);
> + return 0;
> +}
> +
> +static const struct i2c_device_id max44000_id[] = {
> + {"max44000", 0},
> + { }
> +};
> +MODULE_DEVICE_TABLE(i2c, max44000_id);
> +
> +#ifdef CONFIG_OF
> +static const struct of_device_id max44000_of_match[] = {
> + { .compatible = "maxim,max44000" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, max44000_of_match);
> +#endif
> +
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id max44000_acpi_match[] = {
> + {"MAX44000", 0},
> + { }
> +};
> +MODULE_DEVICE_TABLE(acpi, max44000_acpi_match);
> +#endif
> +
> +static struct i2c_driver max44000_driver = {
> + .driver = {
> + .name = MAX44000_DRV_NAME,
> + .of_match_table = of_match_ptr(max44000_of_match),
> + .acpi_match_table = ACPI_PTR(max44000_acpi_match),
> + },
> + .probe = max44000_probe,
> + .remove = max44000_remove,
> + .id_table = max44000_id,
> +};
> +
> +module_i2c_driver(max44000_driver);
> +
> +MODULE_AUTHOR("Crestez Dan Leonard ");
> +MODULE_DESCRIPTION("MAX44000 Ambient and Infrared Proximity Sensor");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
dev);
> +}
> +
> +#if defined(CONFIG_OF)
> +static const struct of_device_id ds1803_dt_ids[] = {
> + { .compatible = "maxim,ds1803-010", .data = _cfg[DS1803_010] },
> + { .compatible = "maxim,ds1803-050", .data = _cfg[DS1803_050] },
> + { .compatible = "maxim,ds1803-100", .data = _cfg[DS1803_100] },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, ds1803_dt_ids);
> +#endif /* CONFIG_OF */
> +
> +static const struct i2c_device_id ds1803_id[] = {
> + { "ds1803-010", DS1803_010 },
> + { "ds1803-050", DS1803_050 },
> + { "ds1803-100", DS1803_100 },
> + {}
> +};
> +MODULE_DEVICE_TABLE(i2c, ds1803_id);
> +
> +static struct i2c_driver ds1803_driver = {
> + .driver = {
> + .name = "ds1803",
> + .of_match_table = of_match_ptr(ds1803_dt_ids),
> + },
> + .probe = ds1803_probe,
> + .id_table = ds1803_id,
> +};
> +
> +module_i2c_driver(ds1803_driver);
> +
> +MODULE_AUTHOR("Slawomir Stepien <s...@poczta.fm>");
> +MODULE_DESCRIPTION("DS1803 digital potentiometer");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
; +#if defined(CONFIG_OF)
> +static const struct of_device_id ds1803_dt_ids[] = {
> + { .compatible = "maxim,ds1803-010", .data = _cfg[DS1803_010] },
> + { .compatible = "maxim,ds1803-050", .data = _cfg[DS1803_050] },
> + { .compatible = "maxim,ds1803-100", .data = _cfg[DS1803_100] },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, ds1803_dt_ids);
> +#endif /* CONFIG_OF */
> +
> +static const struct i2c_device_id ds1803_id[] = {
> + { "ds1803-010", DS1803_010 },
> + { "ds1803-050", DS1803_050 },
> + { "ds1803-100", DS1803_100 },
> + {}
> +};
> +MODULE_DEVICE_TABLE(i2c, ds1803_id);
> +
> +static struct i2c_driver ds1803_driver = {
> + .driver = {
> + .name = "ds1803",
> + .of_match_table = of_match_ptr(ds1803_dt_ids),
> + },
> + .probe = ds1803_probe,
> + .id_table = ds1803_id,
> +};
> +
> +module_i2c_driver(ds1803_driver);
> +
> +MODULE_AUTHOR("Slawomir Stepien ");
> +MODULE_DESCRIPTION("DS1803 digital potentiometer");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
; +static const struct acpi_device_id bmi160_acpi_match[] = {
> + {"BMI0160", 0},
> + { },
> +};
> +MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);
> +
> +static struct i2c_driver bmi160_i2c_driver = {
> + .driver = {
> + .name = BMI160_I2C_DRV_NAME,
> + .acpi_match_table = ACPI_PTR(bmi160_acpi_match),
> + },
> + .probe = bmi160_i2c_probe,
> + .remove = bmi160_i2c_remove,
> + .id_table = bmi160_i2c_id,
> +};
> +
> +module_i2c_driver(bmi160_i2c_driver);
> +
> +MODULE_AUTHOR("Daniel Baluta <daniel.bal...@intel.com>");
> +MODULE_DESCRIPTION("BMI160 I2C driver");
> +MODULE_LICENSE("GPL v2");
> diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c
> b/drivers/iio/imu/bmi160/bmi160_spi.c
> new file mode 100644
> index 000..444b723
> --- /dev/null
> +++ b/drivers/iio/imu/bmi160/bmi160_spi.c
> @@ -0,0 +1,71 @@
> +/*
> + * BMI160 - Bosch IMU, SPI bits
> + *
> + * Copyright (c) 2016, Intel Corporation.
> + *
> + * This file is subject to the terms and conditions of version 2 of
> + * the GNU General Public License. See the file COPYING in the main
> + * directory of this archive for more details.
> + *
> + */
> +#include
> +#include
> +#include
> +
> +#include "bmi160.h"
> +
> +#define BMI160_SPI_DRV_NAME "bmi160_spi"
> +
> +static const struct regmap_config bmi160_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> +};
> +
> +static int bmi160_spi_probe(struct spi_device *spi)
> +{
> + struct regmap *regmap;
> + const struct spi_device_id *id = spi_get_device_id(spi);
> +
> + regmap = devm_regmap_init_spi(spi, _regmap_config);
> + if (IS_ERR(regmap)) {
> + dev_err(>dev, "Failed to register spi regmap %d\n",
> + (int)PTR_ERR(regmap));
> + return PTR_ERR(regmap);
> + }
> + return bmi160_core_probe(>dev, regmap, id->name, true);
> +}
> +
> +static int bmi160_spi_remove(struct spi_device *spi)
> +{
> + bmi160_core_remove(>dev);
> +
> + return 0;
> +}
> +
> +static const struct spi_device_id bmi160_spi_id[] = {
> + {"bmi160", 0},
> + {}
> +};
> +
> +MODULE_DEVICE_TABLE(spi, bmi160_spi_id);
> +
> +static const struct acpi_device_id bmi160_acpi_match[] = {
> + {"BMI0160", 0},
> + { },
> +};
> +MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);
> +
> +static struct spi_driver bmi160_spi_driver = {
> + .probe = bmi160_spi_probe,
> + .remove = bmi160_spi_remove,
> + .id_table = bmi160_spi_id,
> + .driver = {
> + .acpi_match_table = ACPI_PTR(bmi160_acpi_match),
> + .name = BMI160_SPI_DRV_NAME,
> + },
> +};
> +module_spi_driver(bmi160_spi_driver);
> +
> +MODULE_AUTHOR("Daniel Baluta <daniel.bal...@intel.com");
> +MODULE_DESCRIPTION("Bosch BMI160 SPI driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
_match[] = {
> + {"BMI0160", 0},
> + { },
> +};
> +MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);
> +
> +static struct i2c_driver bmi160_i2c_driver = {
> + .driver = {
> + .name = BMI160_I2C_DRV_NAME,
> + .acpi_match_table = ACPI_PTR(bmi160_acpi_match),
> + },
> + .probe = bmi160_i2c_probe,
> + .remove = bmi160_i2c_remove,
> + .id_table = bmi160_i2c_id,
> +};
> +
> +module_i2c_driver(bmi160_i2c_driver);
> +
> +MODULE_AUTHOR("Daniel Baluta ");
> +MODULE_DESCRIPTION("BMI160 I2C driver");
> +MODULE_LICENSE("GPL v2");
> diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c
> b/drivers/iio/imu/bmi160/bmi160_spi.c
> new file mode 100644
> index 000..444b723
> --- /dev/null
> +++ b/drivers/iio/imu/bmi160/bmi160_spi.c
> @@ -0,0 +1,71 @@
> +/*
> + * BMI160 - Bosch IMU, SPI bits
> + *
> + * Copyright (c) 2016, Intel Corporation.
> + *
> + * This file is subject to the terms and conditions of version 2 of
> + * the GNU General Public License. See the file COPYING in the main
> + * directory of this archive for more details.
> + *
> + */
> +#include
> +#include
> +#include
> +
> +#include "bmi160.h"
> +
> +#define BMI160_SPI_DRV_NAME "bmi160_spi"
> +
> +static const struct regmap_config bmi160_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> +};
> +
> +static int bmi160_spi_probe(struct spi_device *spi)
> +{
> + struct regmap *regmap;
> + const struct spi_device_id *id = spi_get_device_id(spi);
> +
> + regmap = devm_regmap_init_spi(spi, _regmap_config);
> + if (IS_ERR(regmap)) {
> + dev_err(>dev, "Failed to register spi regmap %d\n",
> + (int)PTR_ERR(regmap));
> + return PTR_ERR(regmap);
> + }
> + return bmi160_core_probe(>dev, regmap, id->name, true);
> +}
> +
> +static int bmi160_spi_remove(struct spi_device *spi)
> +{
> + bmi160_core_remove(>dev);
> +
> + return 0;
> +}
> +
> +static const struct spi_device_id bmi160_spi_id[] = {
> + {"bmi160", 0},
> + {}
> +};
> +
> +MODULE_DEVICE_TABLE(spi, bmi160_spi_id);
> +
> +static const struct acpi_device_id bmi160_acpi_match[] = {
> + {"BMI0160", 0},
> + { },
> +};
> +MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);
> +
> +static struct spi_driver bmi160_spi_driver = {
> + .probe = bmi160_spi_probe,
> + .remove = bmi160_spi_remove,
> + .id_table = bmi160_spi_id,
> + .driver = {
> + .acpi_match_table = ACPI_PTR(bmi160_acpi_match),
> + .name = BMI160_SPI_DRV_NAME,
> + },
> +};
> +module_spi_driver(bmi160_spi_driver);
> +
> +MODULE_AUTHOR("Daniel Baluta +MODULE_DESCRIPTION("Bosch BMI160 SPI driver");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
t; if (err < 0)
> - goto regulator_disable;
> + goto err_buffer_cleanup;
>
> i2c_set_clientdata(client, iio);
>
> return 0;
>
> -regulator_disable:
> +err_buffer_cleanup:
> + iio_triggered_buffer_cleanup(iio);
> +err_regulator_disable:
> regulator_disable(adc->ref);
>
> return err;
> @@ -143,9 +210,9 @@ static int adc081c_remove(struct i2c_client *client)
> }
iio_triggered_buffer_cleanup() in _remove()?
> static const struct i2c_device_id adc081c_id[] = {
> - { "adc081c", 8 },
> - { "adc101c", 10 },
> - { "adc121c", 12 },
> + { "adc081c", (long)_model },
often an enum is used instead of a pointer
> + { "adc101c", (long)_model },
> + { "adc121c", (long)_model },
> { }
> };
> MODULE_DEVICE_TABLE(i2c, adc081c_id);
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
goto regulator_disable;
> + goto err_buffer_cleanup;
>
> i2c_set_clientdata(client, iio);
>
> return 0;
>
> -regulator_disable:
> +err_buffer_cleanup:
> + iio_triggered_buffer_cleanup(iio);
> +err_regulator_disable:
> regulator_disable(adc->ref);
>
> return err;
> @@ -143,9 +210,9 @@ static int adc081c_remove(struct i2c_client *client)
> }
iio_triggered_buffer_cleanup() in _remove()?
> static const struct i2c_device_id adc081c_id[] = {
> - { "adc081c", 8 },
> - { "adc101c", 10 },
> - { "adc121c", 12 },
> + { "adc081c", (long)_model },
often an enum is used instead of a pointer
> + { "adc101c", (long)_model },
> + { "adc121c", (long)_model },
> { }
> };
> MODULE_DEVICE_TABLE(i2c, adc081c_id);
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
_DEVICE_TABLE(i2c, adc081c_id);
> #ifdef CONFIG_OF
> static const struct of_device_id adc081c_of_match[] = {
> { .compatible = "ti,adc081c" },
> + { .compatible = "ti,adc101c" },
> + { .compatible = "ti,adc121c" },
> { }
> };
> MODULE_DEVICE_TABLE(of, adc081c_of_match);
> @@ -149,5 +172,5 @@ static struct i2c_driver adc081c_driver = {
> module_i2c_driver(adc081c_driver);
>
> MODULE_AUTHOR("Thierry Reding <thierry.red...@avionic-design.de>");
> -MODULE_DESCRIPTION("Texas Instruments ADC081C021/027 driver");
> +MODULE_DESCRIPTION("Texas Instruments ADC081C/ADC101C/ADC121C driver");
> MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
> #ifdef CONFIG_OF
> static const struct of_device_id adc081c_of_match[] = {
> { .compatible = "ti,adc081c" },
> + { .compatible = "ti,adc101c" },
> + { .compatible = "ti,adc121c" },
> { }
> };
> MODULE_DEVICE_TABLE(of, adc081c_of_match);
> @@ -149,5 +172,5 @@ static struct i2c_driver adc081c_driver = {
> module_i2c_driver(adc081c_driver);
>
> MODULE_AUTHOR("Thierry Reding ");
> -MODULE_DESCRIPTION("Texas Instruments ADC081C021/027 driver");
> +MODULE_DESCRIPTION("Texas Instruments ADC081C/ADC101C/ADC121C driver");
> MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
\
> + .endianness = IIO_LE, \
> }, \
> .event_spec = _accel_event, \
> .num_event_specs = 1\
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
\
> }, \
> .event_spec = _accel_event, \
> .num_event_specs = 1\
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
"all required i2c functionality\n");
> + return -ENODEV;
> + }
> +
> + indio_dev = devm_iio_device_alloc(>dev, sizeof(*data));
> + if (!indio_dev)
> + return -ENOMEM;
> +
> + data = iio_priv(indio_dev);
> + data->client = client;
> + mutex_init(>mutex);
> +
> + indio_dev->info = _info;
> + indio_dev->name = id->name;
> + indio_dev->dev.parent = >dev;
> + indio_dev->modes = INDIO_DIRECT_MODE;
> + indio_dev->channels = hp206c_channels;
> + indio_dev->num_channels = ARRAY_SIZE(hp206c_channels);
> +
> + i2c_set_clientdata(client, indio_dev);
> +
> + /* Do a soft reset on probe */
> + ret = hp206c_soft_reset(indio_dev);
> + if (ret) {
> + dev_err(>dev, "Failed to reset on startup: %d\n", ret);
> + /* Maybe it will recover later? */
I suggest to
return -ENODEV;
> + }
> +
> + return devm_iio_device_register(>dev, indio_dev);
> +}
> +
> +static const struct i2c_device_id hp206c_id[] = {
> + {"hp206c"},
> + {}
> +};
> +
> +static const struct acpi_device_id hp206c_acpi_match[] = {
> + {"HOP206C", 0},
> + { },
> +};
> +MODULE_DEVICE_TABLE(acpi, hp206c_acpi_match);
> +
> +static struct i2c_driver hp206c_driver = {
> + .probe = hp206c_probe,
> + .id_table = hp206c_id,
> + .driver = {
> + .name = "hp206c",
> + .acpi_match_table = ACPI_PTR(hp206c_acpi_match),
> + },
> +};
> +
> +module_i2c_driver(hp206c_driver);
> +
> +MODULE_DESCRIPTION("HOPERF HP206C precision barometer and altimeter sensor");
> +MODULE_AUTHOR("Leonard Crestez <leonard.cres...@intel.com>");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
all required i2c functionality\n");
> + return -ENODEV;
> + }
> +
> + indio_dev = devm_iio_device_alloc(>dev, sizeof(*data));
> + if (!indio_dev)
> + return -ENOMEM;
> +
> + data = iio_priv(indio_dev);
> + data->client = client;
> + mutex_init(>mutex);
> +
> + indio_dev->info = _info;
> + indio_dev->name = id->name;
> + indio_dev->dev.parent = >dev;
> + indio_dev->modes = INDIO_DIRECT_MODE;
> + indio_dev->channels = hp206c_channels;
> + indio_dev->num_channels = ARRAY_SIZE(hp206c_channels);
> +
> + i2c_set_clientdata(client, indio_dev);
> +
> + /* Do a soft reset on probe */
> + ret = hp206c_soft_reset(indio_dev);
> + if (ret) {
> + dev_err(>dev, "Failed to reset on startup: %d\n", ret);
> + /* Maybe it will recover later? */
I suggest to
return -ENODEV;
> + }
> +
> + return devm_iio_device_register(>dev, indio_dev);
> +}
> +
> +static const struct i2c_device_id hp206c_id[] = {
> + {"hp206c"},
> + {}
> +};
> +
> +static const struct acpi_device_id hp206c_acpi_match[] = {
> + {"HOP206C", 0},
> + { },
> +};
> +MODULE_DEVICE_TABLE(acpi, hp206c_acpi_match);
> +
> +static struct i2c_driver hp206c_driver = {
> + .probe = hp206c_probe,
> + .id_table = hp206c_id,
> + .driver = {
> + .name = "hp206c",
> + .acpi_match_table = ACPI_PTR(hp206c_acpi_match),
> + },
> +};
> +
> +module_i2c_driver(hp206c_driver);
> +
> +MODULE_DESCRIPTION("HOPERF HP206C precision barometer and altimeter sensor");
> +MODULE_AUTHOR("Leonard Crestez ");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
IS_TO_REG(bit),
> > - , 2);
> > - if (ret < 0) {
> > - mutex_unlock(>mutex);
> > - goto err;
> > - }
> > - data->buffer[i++] = ret;
> > - }
> >
REG(bit),
> > - , 2);
> > - if (ret < 0) {
> > - mutex_unlock(>mutex);
> > - goto err;
> > - }
> > - data->buffer[i++] = ret;
> > - }
> > + ret = regmap_bulk_read(d
.data = _cfg[MCP416x_103] },
> + { .compatible = "microchip,mcp4116x-503",
> + .data = _cfg[MCP416x_503] },
> + { .compatible = "microchip,mcp4116x-104",
> + .data = _cfg[MCP416x_104] },
> + { .compatible = "microchip
ta = _cfg[MCP416x_103] },
> + { .compatible = "microchip,mcp4116x-503",
> + .data = _cfg[MCP416x_503] },
> + { .compatible = "microchip,mcp4116x-104",
> + .data = _cfg[MCP416x_104] },
> + { .compatible = "microchip,mcp4123x-502",
> + .data = _cfg[MCP423x_502] },
> + { .compatible = "microchip,mcp4123x-103",
> + .data = _cfg[MCP423x_103] },
> + { .compatible = "microchip,mcp4123x-503",
> + .data = _cfg[MCP423x_503] },
> + { .compatible = "microchip,mcp4123x-104",
> + .data = _cfg[MCP423x_104] },
> + { .compatible = "microchip,mcp4124x-502",
> + .data = _cfg[MCP424x_502] },
> + { .compatible = "microchip,mcp4124x-103",
> + .data = _cfg[MCP424x_103] },
> + { .compatible = "microchip,mcp4124x-503",
> + .data = _cfg[MCP424x_503] },
> + { .compatible = "microchip,mcp4124x-104",
> + .data = _cfg[MCP424x_104] },
> + { .compatible = "microchip,mcp4125x-502",
> + .data = _cfg[MCP425x_502] },
> + { .compatible = "microchip,mcp4125x-103",
> + .data = _cfg[MCP425x_103] },
> + { .compatible = "microchip,mcp4125x-503",
> + .data = _cfg[MCP425x_503] },
> + { .compatible = "microchip,mcp4125x-104",
> + .data = _cfg[MCP425x_104] },
> + { .compatible = "microchip,mcp4126x-502",
> + .data = _cfg[MCP426x_502] },
> + { .compatible = "microchip,mcp4126x-103",
> + .data = _cfg[MCP426x_103] },
> + { .compatible = "microchip,mcp4126x-503",
> + .data = _cfg[MCP426x_503] },
> + { .compatible = "microchip,mcp4126x-104",
> + .data = _cfg[MCP426x_104] },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, mcp41xx_dt_ids);
> +#endif
> +
> +static const struct spi_device_id mcp41xx_id[] = {
> + { "mcp413x-502", MCP413x_502 },
> + { "mcp413x-103", MCP413x_103 },
> + { "mcp413x-503", MCP413x_503 },
> + { "mcp413x-104", MCP413x_104 },
> + { "mcp414x-502", MCP414x_502 },
> + { "mcp414x-103", MCP414x_103 },
> + { "mcp414x-503", MCP414x_503 },
> + { "mcp414x-104", MCP414x_104 },
> + { "mcp415x-502", MCP415x_502 },
> + { "mcp415x-103", MCP415x_103 },
> + { "mcp415x-503", MCP415x_503 },
> + { "mcp415x-104", MCP415x_104 },
> + { "mcp416x-502", MCP416x_502 },
> + { "mcp416x-103", MCP416x_103 },
> + { "mcp416x-503", MCP416x_503 },
> + { "mcp416x-104", MCP416x_104 },
> + { "mcp423x-502", MCP423x_502 },
> + { "mcp423x-103", MCP423x_103 },
> + { "mcp423x-503", MCP423x_503 },
> + { "mcp423x-104", MCP423x_104 },
> + { "mcp424x-502", MCP424x_502 },
> + { "mcp424x-103", MCP424x_103 },
> + { "mcp424x-503", MCP424x_503 },
> + { "mcp424x-104", MCP424x_104 },
> + { "mcp425x-502", MCP425x_502 },
> + { "mcp425x-103", MCP425x_103 },
> + { "mcp425x-503", MCP425x_503 },
> + { "mcp425x-104", MCP425x_104 },
> + { "mcp426x-502", MCP426x_502 },
> + { "mcp426x-103", MCP426x_103 },
> + { "mcp426x-503", MCP426x_503 },
> + { "mcp426x-104", MCP426x_104 },
> + {}
> +};
> +MODULE_DEVICE_TABLE(spi, mcp41xx_id);
> +
> +static struct spi_driver mcp41xx_driver = {
> + .driver = {
> + .name = "mcp41xx",
> + .of_match_table = of_match_ptr(mcp41xx_dt_ids),
> + },
> + .probe = mcp41xx_probe,
> + .remove = mcp41xx_remove,
> + .id_table = mcp41xx_id,
> +};
> +
> +module_spi_driver(mcp41xx_driver);
> +
> +MODULE_AUTHOR("Slawomir Stepien ");
> +MODULE_DESCRIPTION("MCP41XX digital potentiometer");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
;microchip,mcp4262-502",
> + .data = _cfg[MCP426x_502] },
> + { .compatible = "microchip,mcp4262-103",
> + .data = _cfg[MCP426x_103] },
> + { .compatible = "microchip,mcp4262-503",
> + .data = _cfg[MCP426x_503] },
> + { .compatible = "microchip,mcp4262-104",
> + .data = _cfg[MCP426x_104] },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, mcp4131_dt_ids);
> +#endif /* CONFIG_OF */
> +
> +static const struct spi_device_id mcp4131_id[] = {
> + { "mcp4131-502", MCP413x_502 },
> + { "mcp4131-103", MCP413x_103 },
> + { "mcp4131-503", MCP413x_503 },
> + { "mcp4131-104", MCP413x_104 },
> + { "mcp4132-502", MCP413x_502 },
> + { "mcp4132-103", MCP413x_103 },
> + { "mcp4132-503", MCP413x_503 },
> + { "mcp4132-104", MCP413x_104 },
> + { "mcp4141-502", MCP414x_502 },
> + { "mcp4141-103", MCP414x_103 },
> + { "mcp4141-503", MCP414x_503 },
> + { "mcp4141-104", MCP414x_104 },
> + { "mcp4142-502", MCP414x_502 },
> + { "mcp4142-103", MCP414x_103 },
> + { "mcp4142-503", MCP414x_503 },
> + { "mcp4142-104", MCP414x_104 },
> + { "mcp4151-502", MCP415x_502 },
> + { "mcp4151-103", MCP415x_103 },
> + { "mcp4151-503", MCP415x_503 },
> + { "mcp4151-104", MCP415x_104 },
> + { "mcp4152-502", MCP415x_502 },
> + { "mcp4152-103", MCP415x_103 },
> + { "mcp4152-503", MCP415x_503 },
> + { "mcp4152-104", MCP415x_104 },
> + { "mcp4161-502", MCP416x_502 },
> + { "mcp4161-103", MCP416x_103 },
> + { "mcp4161-503", MCP416x_503 },
> + { "mcp4161-104", MCP416x_104 },
> + { "mcp4162-502", MCP416x_502 },
> + { "mcp4162-103", MCP416x_103 },
> + { "mcp4162-503", MCP416x_503 },
> + { "mcp4162-104", MCP416x_104 },
> + { "mcp4231-502", MCP423x_502 },
> + { "mcp4231-103", MCP423x_103 },
> + { "mcp4231-503", MCP423x_503 },
> + { "mcp4231-104", MCP423x_104 },
> + { "mcp4232-502", MCP423x_502 },
> + { "mcp4232-103", MCP423x_103 },
> + { "mcp4232-503", MCP423x_503 },
> + { "mcp4232-104", MCP423x_104 },
> + { "mcp4241-502", MCP424x_502 },
> + { "mcp4241-103", MCP424x_103 },
> + { "mcp4241-503", MCP424x_503 },
> + { "mcp4241-104", MCP424x_104 },
> + { "mcp4242-502", MCP424x_502 },
> + { "mcp4242-103", MCP424x_103 },
> + { "mcp4242-503", MCP424x_503 },
> + { "mcp4242-104", MCP424x_104 },
> + { "mcp4251-502", MCP425x_502 },
> + { "mcp4251-103", MCP425x_103 },
> + { "mcp4251-503", MCP425x_503 },
> + { "mcp4251-104", MCP425x_104 },
> + { "mcp4252-502", MCP425x_502 },
> + { "mcp4252-103", MCP425x_103 },
> + { "mcp4252-503", MCP425x_503 },
> + { "mcp4252-104", MCP425x_104 },
> + { "mcp4261-502", MCP426x_502 },
> + { "mcp4261-103", MCP426x_103 },
> + { "mcp4261-503", MCP426x_503 },
> + { "mcp4261-104", MCP426x_104 },
> + { "mcp4262-502", MCP426x_502 },
> + { "mcp4262-103", MCP426x_103 },
> + { "mcp4262-503", MCP426x_503 },
> + { "mcp4262-104", MCP426x_104 },
> + {}
> +};
> +MODULE_DEVICE_TABLE(spi, mcp4131_id);
> +
> +static struct spi_driver mcp4131_driver = {
> + .driver = {
> + .name = "mcp4131",
> + .of_match_table = of_match_ptr(mcp4131_dt_ids),
> + },
> + .probe = mcp4131_probe,
> + .remove = mcp4131_remove,
> + .id_table = mcp4131_id,
> +};
> +
> +module_spi_driver(mcp4131_driver);
> +
> +MODULE_AUTHOR("Slawomir Stepien <s...@poczta.fm>");
> +MODULE_DESCRIPTION("MCP4131 digital potentiometer");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
ot;,
> + .data = _cfg[MCP426x_502] },
> + { .compatible = "microchip,mcp4262-103",
> + .data = _cfg[MCP426x_103] },
> + { .compatible = "microchip,mcp4262-503",
> + .data = _cfg[MCP426x_503] },
> + { .compatible = "microchip,mcp4262-104",
> + .data = _cfg[MCP426x_104] },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, mcp4131_dt_ids);
> +#endif /* CONFIG_OF */
> +
> +static const struct spi_device_id mcp4131_id[] = {
> + { "mcp4131-502", MCP413x_502 },
> + { "mcp4131-103", MCP413x_103 },
> + { "mcp4131-503", MCP413x_503 },
> + { "mcp4131-104", MCP413x_104 },
> + { "mcp4132-502", MCP413x_502 },
> + { "mcp4132-103", MCP413x_103 },
> + { "mcp4132-503", MCP413x_503 },
> + { "mcp4132-104", MCP413x_104 },
> + { "mcp4141-502", MCP414x_502 },
> + { "mcp4141-103", MCP414x_103 },
> + { "mcp4141-503", MCP414x_503 },
> + { "mcp4141-104", MCP414x_104 },
> + { "mcp4142-502", MCP414x_502 },
> + { "mcp4142-103", MCP414x_103 },
> + { "mcp4142-503", MCP414x_503 },
> + { "mcp4142-104", MCP414x_104 },
> + { "mcp4151-502", MCP415x_502 },
> + { "mcp4151-103", MCP415x_103 },
> + { "mcp4151-503", MCP415x_503 },
> + { "mcp4151-104", MCP415x_104 },
> + { "mcp4152-502", MCP415x_502 },
> + { "mcp4152-103", MCP415x_103 },
> + { "mcp4152-503", MCP415x_503 },
> + { "mcp4152-104", MCP415x_104 },
> + { "mcp4161-502", MCP416x_502 },
> + { "mcp4161-103", MCP416x_103 },
> + { "mcp4161-503", MCP416x_503 },
> + { "mcp4161-104", MCP416x_104 },
> + { "mcp4162-502", MCP416x_502 },
> + { "mcp4162-103", MCP416x_103 },
> + { "mcp4162-503", MCP416x_503 },
> + { "mcp4162-104", MCP416x_104 },
> + { "mcp4231-502", MCP423x_502 },
> + { "mcp4231-103", MCP423x_103 },
> + { "mcp4231-503", MCP423x_503 },
> + { "mcp4231-104", MCP423x_104 },
> + { "mcp4232-502", MCP423x_502 },
> + { "mcp4232-103", MCP423x_103 },
> + { "mcp4232-503", MCP423x_503 },
> + { "mcp4232-104", MCP423x_104 },
> + { "mcp4241-502", MCP424x_502 },
> + { "mcp4241-103", MCP424x_103 },
> + { "mcp4241-503", MCP424x_503 },
> + { "mcp4241-104", MCP424x_104 },
> + { "mcp4242-502", MCP424x_502 },
> + { "mcp4242-103", MCP424x_103 },
> + { "mcp4242-503", MCP424x_503 },
> + { "mcp4242-104", MCP424x_104 },
> + { "mcp4251-502", MCP425x_502 },
> + { "mcp4251-103", MCP425x_103 },
> + { "mcp4251-503", MCP425x_503 },
> + { "mcp4251-104", MCP425x_104 },
> + { "mcp4252-502", MCP425x_502 },
> + { "mcp4252-103", MCP425x_103 },
> + { "mcp4252-503", MCP425x_503 },
> + { "mcp4252-104", MCP425x_104 },
> + { "mcp4261-502", MCP426x_502 },
> + { "mcp4261-103", MCP426x_103 },
> + { "mcp4261-503", MCP426x_503 },
> + { "mcp4261-104", MCP426x_104 },
> + { "mcp4262-502", MCP426x_502 },
> + { "mcp4262-103", MCP426x_103 },
> + { "mcp4262-503", MCP426x_503 },
> + { "mcp4262-104", MCP426x_104 },
> + {}
> +};
> +MODULE_DEVICE_TABLE(spi, mcp4131_id);
> +
> +static struct spi_driver mcp4131_driver = {
> + .driver = {
> + .name = "mcp4131",
> + .of_match_table = of_match_ptr(mcp4131_dt_ids),
> + },
> + .probe = mcp4131_probe,
> + .remove = mcp4131_remove,
> + .id_table = mcp4131_id,
> +};
> +
> +module_spi_driver(mcp4131_driver);
> +
> +MODULE_AUTHOR("Slawomir Stepien ");
> +MODULE_DESCRIPTION("MCP4131 digital potentiometer");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
val, val2);
> + val, val2, );
>
> - if (i < 0)
> - return i;
> + if (ret < 0)
> + return ret;
>
> mutex_lock(>lock_ps);
> ret = regmap_field_write(data->reg_ps_rate, i);
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
val, val2);
> + val, val2, );
>
> - if (i < 0)
> - return i;
> + if (ret < 0)
> + return ret;
>
> mutex_lock(>lock_ps);
> ret = regmap_field_write(data->reg_ps_rate, i);
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
t; +indio_dev->name,
> +indio_dev->id);
> + if (!afe->trig) {
> + dev_err(afe->dev, "Unable to allocate IIO trigger\n");
> +
ocate IIO trigger\n");
> + return -ENOMEM;
> + }
> +
> + iio_trigger_set_drvdata(afe->trig, indio_dev);
> +
> + afe->trig->ops = _trigger_ops;
> + afe->trig->dev.parent = afe->dev;
> +
> + ret = iio_trigger_register(afe->trig);
> + if (ret) {
> + dev_err(afe->dev, "Unable to register IIO trigger\n");
> + return ret;
> + }
> +
> + ret = devm_request_threaded_irq(afe->dev, afe->irq,
> +
> iio_trigger_generic_data_rdy_poll,
> + NULL, IRQF_ONESHOT,
> + AFE4403_DRIVER_NAME,
> + afe->trig);
> + if (ret) {
> + dev_err(afe->dev, "Unable to request IRQ\n");
> + return ret;
> + }
> + }
> +
> + ret = iio_triggered_buffer_setup(indio_dev, _pollfunc_store_time,
> + afe4403_trigger_handler, NULL);
> + if (ret) {
> + dev_err(afe->dev, "Unable to setup buffer\n");
> + return ret;
> + }
> +
> + ret = iio_device_register(indio_dev);
> + if (ret) {
> + dev_err(afe->dev, "Unable to register IIO device\n");
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> +static int afe4403_remove(struct spi_device *spi)
> +{
> + struct iio_dev *indio_dev = spi_get_drvdata(spi);
> + struct afe4403_data *afe = iio_priv(indio_dev);
> + int ret;
> +
> + iio_device_unregister(indio_dev);
> +
> + iio_trigger_unregister(afe->trig);
> +
> + ret = regulator_disable(afe->regulator);
> + if (ret) {
> + dev_err(afe->dev, "Unable to disable regulator\n");
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> +static const struct spi_device_id afe4403_ids[] = {
> + { "afe4403", 0 },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(spi, afe4403_ids);
> +
> +static struct spi_driver afe4403_spi_driver = {
> + .driver = {
> + .name = AFE4403_DRIVER_NAME,
> + .of_match_table = of_match_ptr(afe4403_of_match),
> + .pm = _pm_ops,
> + },
> + .probe = afe4403_probe,
> + .remove = afe4403_remove,
> + .id_table = afe4403_ids,
> +};
> +module_spi_driver(afe4403_spi_driver);
> +
> +MODULE_AUTHOR("Andrew F. Davis <a...@ti.com>");
> +MODULE_DESCRIPTION("TI AFE4403 Heart Rate and Pulse Oximeter");
> +MODULE_LICENSE("GPL v2");
>
--
Peter Meerwald-Stadler
+43-664-218 (mobile)
ltage reference
> Thanks to Jonathan Cameron
>
> v2: A lot of CodeStyle Fixes
> Thanks to Peter Meerwald-Stadler and
> Jonathan Cameron
>
> CREDITS| 1 +
> drivers/iio/dac/Kconfig| 10 +
> dri
ata
> Exit on error instead of using internal voltage reference
> Thanks to Jonathan Cameron <ji...@kernel.org>
>
> v2: A lot of CodeStyle Fixes
> Thanks to Peter Meerwald-Stadler <pme...@pmeerw.net> and
> Jonathan Cameron <ji...@kernel.org>
>
>
ref && !chip_info->int_vref) {
> + dev_err(>dev, "Missing vref, cannot continue");
> + return -EIO;
> + }
> +
> + ad5761_spi_set_range(st, MODE_0V_5V);
this can fail, retval not checked
> +
> + iio_dev->dev.parent =
e of variables
> + if (st->use_intref && !chip_info->int_vref) {
> + dev_err(>dev, "Missing vref, cannot continue");
> + return -EIO;
> + }
> +
> + ad5761_spi_set_range(st, MODE_0V_5V);
this can fail, retval not checked
&
> > -Original Message-
> > From: Peter Meerwald-Stadler [mailto:pme...@pmeerw.net]
> > Sent: Tuesday, December 01, 2015 4:51 PM
> > To: Chen Haibo-B51421
> > Cc: ji...@kernel.org; knaac...@gmx.de; l...@metafoo.de;
> > shawn...@kernel.org; linux
+}
> +
> +static void imx7d_adc_power_down(struct imx7d_adc *info)
> +{
> + u32 adc_cfg;
> +
> + adc_cfg = readl(info->regs + IMX7D_REG_ADC_ADC_CFG);
> + adc_cfg |= IMX7D_REG_ADC_ADC_CFG_ADC_CLK_DOWN |
> +IMX7D_REG_ADC_ADC_CFG_ADC_POWER_DOWN;
> + adc_cfg
;
> +}
> +
> +static void imx7d_adc_power_down(struct imx7d_adc *info)
> +{
> + u32 adc_cfg;
> +
> + adc_cfg = readl(info->regs + IMX7D_REG_ADC_ADC_CFG);
> + adc_cfg |= IMX7D_REG_ADC_ADC_CFG_ADC_CLK_DOWN |
> +IMX7D_REG_ADC_ADC_CFG_ADC_POWER_DOW
> > -Original Message-
> > From: Peter Meerwald-Stadler [mailto:pme...@pmeerw.net]
> > Sent: Tuesday, December 01, 2015 4:51 PM
> > To: Chen Haibo-B51421
> > Cc: ji...@kernel.org; knaac...@gmx.de; l...@metafoo.de;
> > shawn...@kernel.org; linux
ndio_dev->name = id->name;
> + indio_dev->channels = ina2xx_channels;
> + indio_dev->num_channels = ARRAY_SIZE(ina2xx_channels);
> +
> + indio_dev->dev.parent = >dev;
> + indio_dev->info = _info;
> + indio_dev->modes = INDIO_DIRECT_M
set_clientdata(client, indio_dev);
> +
> + indio_dev->name = id->name;
> + indio_dev->channels = ina2xx_channels;
> + indio_dev->num_channels = ARRAY_SIZE(ina2xx_channels);
> +
> + indio_dev->dev.parent = >dev;
> + indio_dev->info = _inf
;
> +
> + indio_dev->name = id->name;
> + indio_dev->channels = ina2xx_channels;
> + indio_dev->num_channels = ARRAY_SIZE(ina2xx_channels);
> +
> + indio_dev->dev.parent = >dev;
> + indio_dev->info = _info;
> + indio_dev->modes = INDIO_DIRECT_
; + i2c_set_clientdata(client, indio_dev);
> +
> + indio_dev->name = id->name;
> + indio_dev->channels = ina2xx_channels;
> + indio_dev->num_channels = ARRAY_SIZE(ina2xx_channels);
> +
> + indio_dev->dev.parent = >dev;
> + indio_dev->info =
+ return 0;
> +
> +error_iio_device_register:
> + clk_disable_unprepare(info->clk);
> +error_adc_clk_enable:
> + regulator_disable(info->vref);
> +
> + return ret;
> +}
> +
> +static int imx7d_adc_remove(struct platform_device *pdev)
> +{
> + struct iio_dev *ind
> + struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> + struct imx7d_adc *info = iio_priv(indio_dev);
> +
> + iio_device_unregister(indio_dev);
> + regulator_disable(info->vref);
> + clk_disable_unprepare(info->clk);
should be in the same order
P,
> + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
> + BIT(IIO_CHAN_INFO_SCALE),
> + }
> +};
> +
> +static const struct iio_info as6200_info = {
> + .read_raw = as6200_read_raw,
> + .attrs = _attr_group,
> + .driver_module = THIS_MODULE,
> +};
> +
> +static int as6200_detect(struct i2c_client *client,
> + struct i2c_board_info *info)
> +{
> + struct i2c_adapter *adapter = client->adapter;
> + const char *name = NULL;
> + char tx_buf[1];
> + char rx_buf[2];
> +
> + if (!i2c_check_functionality(adapter, I2C_FUNC_I2C |
> + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA))
> + return -ENODEV;
> + tx_buf[0] = 0x03;
> + i2c_master_send(client, tx_buf, 1);
> + i2c_master_recv(client, rx_buf, 2);
> + if (rx_buf[0] != 0x40 && rx_buf[1] != 0xA0)
> + return -ENODEV;
> +
> + name = "as6200";
> +
> + strlcpy(info->type, name, I2C_NAME_SIZE);
> +
> + return 0;
> +}
> +
> +static void initClientData(struct as6200_data *data)
> +{
> + data->dw = 0;
> + data->al = 1;
> + data->cr = 2; /* 250ms */
> + data->sm = 0; /* continuous or sleep mode */
use bool or enum?
> + data->im = 0; /* comparator */
> + data->pol = 0; /* alert irq active low */
> + data->cf = 0; /* 1 consecutive faults */
> + data->ss = 0; /* single shot conversion */
> +
> + /* registers */
> + data->config = 0x40A0; /* reflect above settings */
> + data->thigh = 0x4B00;
> + data->tlow = 0x5000;
> +}
> +
> +static int as6200_probe(struct i2c_client *client,
> + const struct i2c_device_id *id)
> +{
> + struct iio_dev *indio_dev = NULL;
> + struct as6200_data *data = NULL;
> +
> + indio_dev = devm_iio_device_alloc(>dev, sizeof(*data));
drop newline here
> +
> + if (!indio_dev)
> + return -ENOMEM;
> +
> + data = iio_priv(indio_dev);
> + i2c_set_clientdata(client, indio_dev);
> + data->client = client;
> +
> + indio_dev->dev.parent = >dev;
> + indio_dev->name = dev_name(>dev);
> + indio_dev->modes = INDIO_DIRECT_MODE;
> + indio_dev->info = _info;
> +
> + indio_dev->channels = as6200_channels;
> + indio_dev->num_channels = ARRAY_SIZE(as6200_channels);
> +
> + initClientData(data);
> + mutex_init(>update_lock);
> + setupIRQ(indio_dev, true, 0);
> +
> + return iio_device_register(indio_dev);
> +}
> +
> +static int as6200_remove(struct i2c_client *client)
> +{
> + struct iio_dev *indio_dev;
> + struct as6200_data *data;
> + int irq_num;
> +
> + indio_dev = i2c_get_clientdata(client);
> + data = iio_priv(indio_dev);
> +
> + iio_device_unregister(indio_dev);
> + irq_num = data->irqn;
drop irq_num
> + free_irq(irq_num, >dev);
> + gpio_free(49);
magic 49?
> + return 0;
> +}
> +
> +static struct i2c_driver as6200_driver = {
> + .driver = {
> + .name = "as6200",
> + .owner = THIS_MODULE,
> + },
> + .probe = as6200_probe,
> + .remove = as6200_remove,
> + .id_table = as6200_id,
> + .detect = as6200_detect,
> + .address_list = normal_i2c,
i2c device are generally not auto-detected; drop .detect, .address_list
> +};
> +
> +static int __init as6200_init(void)
> +{
> + return i2c_add_driver(_driver);
> +}
> +
> +static void __exit as6200_exit(void)
> +{
> + i2c_del_driver(_driver);
> +}
> +module_init(as6200_init);
> +module_exit(as6200_exit);
use module_i2c_driver()
> +
> +MODULE_DESCRIPTION("ams AS6200 temperature sensor");
> +MODULE_AUTHOR("Elitsa Polizoeva ");
> +MODULE_AUTHOR("Florian Lobmaier ");
> +MODULE_LICENSE("GPL");
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Peter Meerwald
+43-664-218 (mobile)
ad_raw,
> + .attrs = _attr_group,
> + .driver_module = THIS_MODULE,
> +};
> +
> +static int as6200_detect(struct i2c_client *client,
> + struct i2c_board_info *info)
> +{
> + struct i2c_adapter *adapter = client->adapter;
> + const char *name = NULL;
> + char tx_buf[1];
> + char rx_buf[2];
> +
> + if (!i2c_check_functionality(adapter, I2C_FUNC_I2C |
> + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA))
> + return -ENODEV;
> + tx_buf[0] = 0x03;
> + i2c_master_send(client, tx_buf, 1);
> + i2c_master_recv(client, rx_buf, 2);
> + if (rx_buf[0] != 0x40 && rx_buf[1] != 0xA0)
> + return -ENODEV;
> +
> + name = "as6200";
> +
> + strlcpy(info->type, name, I2C_NAME_SIZE);
> +
> + return 0;
> +}
> +
> +static void initClientData(struct as6200_data *data)
> +{
> + data->dw = 0;
> + data->al = 1;
> + data->cr = 2; /* 250ms */
> + data->sm = 0; /* continuous or sleep mode */
use bool or enum?
> + data->im = 0; /* comparator */
> + data->pol = 0; /* alert irq active low */
> + data->cf = 0; /* 1 consecutive faults */
> + data->ss = 0; /* single shot conversion */
> +
> + /* registers */
> + data->config = 0x40A0; /* reflect above settings */
> + data->thigh = 0x4B00;
> + data->tlow = 0x5000;
> +}
> +
> +static int as6200_probe(struct i2c_client *client,
> + const struct i2c_device_id *id)
> +{
> + struct iio_dev *indio_dev = NULL;
> + struct as6200_data *data = NULL;
> +
> + indio_dev = devm_iio_device_alloc(>dev, sizeof(*data));
drop newline here
> +
> + if (!indio_dev)
> + return -ENOMEM;
> +
> + data = iio_priv(indio_dev);
> + i2c_set_clientdata(client, indio_dev);
> + data->client = client;
> +
> + indio_dev->dev.parent = >dev;
> + indio_dev->name = dev_name(>dev);
> + indio_dev->modes = INDIO_DIRECT_MODE;
> + indio_dev->info = _info;
> +
> + indio_dev->channels = as6200_channels;
> + indio_dev->num_channels = ARRAY_SIZE(as6200_channels);
> +
> + initClientData(data);
> + mutex_init(>update_lock);
> + setupIRQ(indio_dev, true, 0);
> +
> + return iio_device_register(indio_dev);
> +}
> +
> +static int as6200_remove(struct i2c_client *client)
> +{
> + struct iio_dev *indio_dev;
> + struct as6200_data *data;
> + int irq_num;
> +
> + indio_dev = i2c_get_clientdata(client);
> + data = iio_priv(indio_dev);
> +
> + iio_device_unregister(indio_dev);
> + irq_num = data->irqn;
drop irq_num
> + free_irq(irq_num, >dev);
> + gpio_free(49);
magic 49?
> + return 0;
> +}
> +
> +static struct i2c_driver as6200_driver = {
> + .driver = {
> + .name = "as6200",
> + .owner = THIS_MODULE,
> + },
> + .probe = as6200_probe,
> + .remove = as6200_remove,
> + .id_table = as6200_id,
> + .detect = as6200_detect,
> + .address_list = normal_i2c,
i2c device are generally not auto-detected; drop .detect, .address_list
> +};
> +
> +static int __init as6200_init(void)
> +{
> + return i2c_add_driver(_driver);
> +}
> +
> +static void __exit as6200_exit(void)
> +{
> + i2c_del_driver(_driver);
> +}
> +module_init(as6200_init);
> +module_exit(as6200_exit);
use module_i2c_driver()
> +
> +MODULE_DESCRIPTION("ams AS6200 temperature sensor");
> +MODULE_AUTHOR("Elitsa Polizoeva <elitsa.polizo...@ams.com>");
> +MODULE_AUTHOR("Florian Lobmaier <florian.lobma...@ams.com>");
> +MODULE_LICENSE("GPL");
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Peter Meerwald
+43-664-218 (mobile)
x\n", chip_id);
maybe check chip id?
> +
> + ret = devm_iio_device_register(>dev, indio_dev);
> + if (ret < 0) {
> + dev_err(>dev, "Could not register IIO device\n");
> + return ret;
> + }
> +
> + return 0;
>
(>dev, "Chip id %x\n", chip_id);
maybe check chip id?
> +
> + ret = devm_iio_device_register(>dev, indio_dev);
> + if (ret < 0) {
> + dev_err(>dev, "Could not register IIO device\n");
> + return ret;
> + }
>
xt
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
> @@ -46,6 +46,7 @@ digilentDiglent, Inc.
> dlg Dialog Semiconductor
> dlink D-Link Corporation
> dmo Data Modul AG
> +dynaimageDyna-Image
> ebv EBV Elektronik
> edt Emerging Displa
etree/bindings/vendor-prefixes.txt
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
> @@ -46,6 +46,7 @@ digilentDiglent, Inc.
> dlg Dialog Semiconductor
> dlink D-Link Corporation
> dmo Data Modul AG
> +dynaimageDyna-Image
> ebv EBV Elekt
> +#define AP3223_SYS_PS_INT_OBJ 0x10
> +#define AP3223_SYS_PS_INT_IROV 0x20
> +
> +/* INT CLEAN Mode */
> +#define AP3223_SYS_ICLEAN_AUTO 0x00
> +#define AP3223_SYS_ICLEAN_MANUAL 0x01
> +
> +/* ALS CONFIG */
> +#define AP3223_ALS_RANGE_0 0x00/* Full range 32768
0x02
> +#define AP3223_SYS_PS_INT_OBJ 0x10
> +#define AP3223_SYS_PS_INT_IROV 0x20
> +
> +/* INT CLEAN Mode */
> +#define AP3223_SYS_ICLEAN_AUTO 0x00
> +#define AP3223_SYS_ICLEAN_MANUAL 0x01
> +
> +/* ALS CONFIG */
> +#define AP3223_AL
.pm = _pm_ops,
> + },
> +};
> +
> +static int __init palmas_gpadc_init(void)
> +{
> + return platform_driver_register(_gpadc_driver);
> +}
> +module_init(palmas_gpadc_init);
> +
> +static void __exit palmas_gpadc_exit(void)
> +{
> + platform_
e_init(palmas_gpadc_init);
> +
> +static void __exit palmas_gpadc_exit(void)
> +{
> + platform_driver_unregister(_gpadc_driver);
> +}
> +module_exit(palmas_gpadc_exit);
> +
> +MODULE_DESCRIPTION("palmas GPADC driver");
> +MODULE_AUTHOR("Pra
rent = dev;
> + indio_dev->info = _info;
> + indio_dev->channels = mcp4531_channels;
> + indio_dev->num_channels = MCP4531_WIPERS(devid);
> + indio_dev->name = client->name;
> +
> + return iio_device_register(indio_dev);
use devm_ ...
> +}
> +
> +
> + data->max_pos = (1 << MCP4531_MAX_POS(devid)) + 1;
> +
> + indio_dev->dev.parent = dev;
> + indio_dev->info = _info;
> + indio_dev->channels = mcp4531_channels;
> + indio_dev->num_channels = MCP4531_WIPERS(devid);
> + indio_dev->nam
> +switch (chan->type) {
> >> +case IIO_RESISTANCE:
> >> +*val = 10;
> >> + ret = IIO_VAL_INT;
> >> +break;
> >> +case IIO_CONCENTRATION:
> >> +ret = vz89x_get_channel_s
- HZ;
> + mutex_init(>lock);
> +
> + indio_dev->dev.parent = >dev;
> + indio_dev->info = _info,
> + indio_dev->name = dev_name(>dev);
> + indio_dev->modes = INDIO_DIRECT_MODE;
> +
> + indio_dev->channels = vz89x_channels;
> + indio_dev->nu
++ b/include/uapi/linux/iio/types.h
> @@ -35,6 +35,7 @@ enum iio_chan_type {
> IIO_ENERGY,
> IIO_DISTANCE,
> IIO_VELOCITY,
> + IIO_CONCENTRATION,
> };
>
> enum iio_modifier {
> @@ -72,6 +73,8 @@ enum iio_modifier {
> IIO_MOD_ROOT_SUM_SQU
client;
> + data->last_update = jiffies - HZ;
> + mutex_init(>lock);
> +
> + indio_dev->dev.parent = >dev;
> + indio_dev->info = _info,
> + indio_dev->name = dev_name(>dev);
> + indio_dev->modes = INDIO_DIRECT_MODE;
> +
> + indio_dev-&
> >> +case IIO_CHAN_INFO_SCALE:
> >> +switch (chan->type) {
> >> +case IIO_RESISTANCE:
> >> +*val = 10;
> >> +ret = IIO_VAL_INT;
> >> +break;
> >> +case IIO_CONCENTRATIO
gt; --- a/include/uapi/linux/iio/types.h
> +++ b/include/uapi/linux/iio/types.h
> @@ -35,6 +35,7 @@ enum iio_chan_type {
> IIO_ENERGY,
> IIO_DISTANCE,
> IIO_VELOCITY,
> + IIO_CONCENTRATION,
> };
>
> enum iio_modifier {
> @@ -72,6 +73,8 @@ enum iio_modifier {
&
+ indio_dev->info = _info;
> + indio_dev->name = US5182D_DRV_NAME;
> + indio_dev->channels = us5182d_channels;
> + indio_dev->num_channels = ARRAY_SIZE(us5182d_channels);
> + indio_dev->modes = INDIO_DIRECT_MODE;
> +
> + ret = i2c_smbus_re
,
+ .id_table = us5182d_id,
+
+};
+module_i2c_driver(us5182d_driver);
+
+MODULE_AUTHOR(Adriana Reus adriana.r...@intel.com);
+MODULE_DESCRIPTION(Driver for us5182d Proximity and Light Sensor);
+MODULE_LICENSE(GPL v2);
--
Peter Meerwald
+43-664-218 (mobile)
--
To unsubscribe from
= MMC35240_16_BITS_SLOW;
>
> + if (id) {
> + data->chipset = (enum mmc35240_chipset)(id->driver_data);
> + name = id->name;
> + } else if (ACPI_HANDLE(>dev)) {
> + name = mmc35240_match_acpi_device(>dev,
> +
},
- {}
+ {mmc35240, MMC35240},
+ {mmc34160, MMC34160},
+ { }
};
MODULE_DEVICE_TABLE(i2c, mmc35240_id);
--
Peter Meerwald
+43-664-218 (mobile)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More
> + {"bmi055_gyro", 0},
> + {}
> +};
> +
> +MODULE_DEVICE_TABLE(spi, bmg160_spi_id);
> +
> +static struct spi_driver bmg160_spi_driver = {
> + .driver = {
> + .name = "bmg160_spi",
> + .pm = _
= bmg160_spi_remove,
+ .id_table = bmg160_spi_id,
+};
+module_spi_driver(bmg160_spi_driver);
+
+MODULE_AUTHOR(Markus Pargmann m...@pengutronix.de);
+MODULE_LICENSE(GPL v2);
+MODULE_DESCRIPTION(BMG160 SPI Gyro driver);
--
Peter Meerwald
+43-664-218 (mobile)
--
To unsubscribe
> Now the core implements the work queue, remove it from the drivers.
nice!
> Signed-off-by: Andrew Lunn
> Signed-off-by: Jacek Anaszewski
> Cc: Peter Meerwald
> Cc: Ricardo Ribalda
Acked-by: Peter Meerwald
> ---
> drivers/leds/
Now the core implements the work queue, remove it from the drivers.
nice!
Signed-off-by: Andrew Lunn and...@lunn.ch
Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
Cc: Peter Meerwald p.meerw...@bct-electronic.com
Cc: Ricardo Ribalda ricardo.riba...@gmail.com
Acked-by: Peter
201 - 300 of 460 matches
Mail list logo