Re: [PATCH v2 7/7] iio: pressure bmp280: Move bmp085 interrupt to new configuration

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

 



On Fri, 26 Jul 2024 01:10:39 +0200
Vasileios Amoiridis <vassilisamir@xxxxxxxxx> wrote:

> This commit intends to add the old BMP085 sensor to the new IRQ interface
> of the sensor consistence. No functional changes intended.
> 
> The BMP085 sensor is equivalent with the BMP180 with the only difference of
> BMP085 having an extra interrupt pin to inform about an End of Conversion.
> 
> Signed-off-by: Vasileios Amoiridis <vassilisamir@xxxxxxxxx>
Trivial comments inline + as the build bot pointed out you can't use data from
one array to fill the other.

Jonathan

> ---
>  drivers/iio/pressure/bmp280-core.c | 72 +++++++++++++++++++++++-------
>  drivers/iio/pressure/bmp280-i2c.c  |  4 +-
>  drivers/iio/pressure/bmp280-spi.c  |  4 +-
>  drivers/iio/pressure/bmp280.h      |  1 +
>  4 files changed, 60 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
> index 4238f37b7805..e4d017358b68 100644
> --- a/drivers/iio/pressure/bmp280-core.c
> +++ b/drivers/iio/pressure/bmp280-core.c
> @@ -3104,13 +3104,19 @@ static irqreturn_t bmp085_eoc_irq(int irq, void *d)
>  	return IRQ_HANDLED;
>  }
>  
> -static int bmp085_fetch_eoc_irq(struct device *dev,
> -				const char *name,
> -				int irq,
> -				struct bmp280_data *data)
> +static int bmp085_trigger_probe(struct iio_dev *indio_dev)
>  {
> +	struct bmp280_data *data = iio_priv(indio_dev);
> +	struct device *dev = data->dev;
> +	struct fwnode_handle *fwnode;
>  	unsigned long irq_trig;
> -	int ret;
> +	int ret, irq;
> +
> +	fwnode = dev_fwnode(data->dev);
> +	if (!fwnode)
> +		return -ENODEV;
> +
> +	irq = fwnode_irq_get(fwnode, 0);
>  
>  	irq_trig = irqd_get_trigger_type(irq_get_irq_data(irq));
>  	if (irq_trig != IRQF_TRIGGER_RISING) {
> @@ -3120,13 +3126,12 @@ static int bmp085_fetch_eoc_irq(struct device *dev,
>  
>  	init_completion(&data->done);
>  
> -	ret = devm_request_threaded_irq(dev,
> -			irq,
> -			bmp085_eoc_irq,
> -			NULL,
> -			irq_trig,
> -			name,
> -			data);
> +	ret = devm_request_irq(dev,
> +			       irq,
> +			       bmp085_eoc_irq,
> +			       irq_trig,
> +			       indio_dev->name,
> +			       data);
Whilst here, put some of those parameters on the same line (staying below
80 chars).

>  	if (ret) {
>  		/* Bail out without IRQ but keep the driver in place */
>  		dev_err(dev, "unable to request DRDY IRQ\n");
> @@ -3137,6 +3142,44 @@ static int bmp085_fetch_eoc_irq(struct device *dev,
>  	return 0;
>  }
>  
> +const struct bmp280_chip_info bmp085_chip_info = {
> +	.id_reg = bmp180_chip_info.id_reg,
As the build bot has pointed out you can't do this.
Annoying but just duplicate the original structure with whatever
changes you need.





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

  Powered by Linux