All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Add support for BMP390 and various driver cleanups
@ 2023-10-22 17:22 Angel Iglesias
  2023-10-22 17:22 ` [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data() Angel Iglesias
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Angel Iglesias @ 2023-10-22 17:22 UTC (permalink / raw)
  To: linux-iio
  Cc: Biju Das, linux-kernel, Angel Iglesias, Jonathan Cameron,
	Lars-Peter Clausen, Andy Shevchenko, Phil Elwell, Linus Walleij,
	Uwe Kleine-König

Add support for the Bosch BMP390 pressure sensors and includes minor
driver code cleanups.
Patches 1 and 2 update I2C and SPI driver matching logic using newer
helper functions available.
Patch 3 fixes minor coding style incoherences.
Patches 4 and 5 introduce support for the new BMP390 sensor allowing
sensor families to have a list of known device IDs to improve detection

This patch series is aggregates patches from various series:
https://lore.kernel.org/all/20230812175808.236405-1-biju.das.jz@bp.renesas.com/
https://lore.kernel.org/all/cover.1691952005.git.ang.iglesiasg@gmail.com/
https://lore.kernel.org/all/cover.1692805377.git.ang.iglesiasg@gmail.com/

Changes in v2:
	- Dropped unnecessary register reorder in patch 3.
	- Simplified error reporting on patch 4 avoiding string memallocs.
	- Added fallback logic on patch 4 to follow firmware configuration
	  whether device ID matches with any of the known devices IDs.


Angel Iglesias (4):
  iio: pressure: bmp280: Use spi_get_device_match_data()
  iio: pressure: bmp280: Rearrange vars in reverse xmas tree order
  iio: pressure: bmp280: Allow multiple chips id per family of devices
  iio: pressure: bmp280: Add support for BMP390

Biju Das (1):
  iio: pressure: bmp280: Use i2c_get_match_data()

 drivers/iio/pressure/bmp280-core.c | 38 +++++++++++++++++++++++-------
 drivers/iio/pressure/bmp280-i2c.c  |  8 +++----
 drivers/iio/pressure/bmp280-spi.c  | 10 +++-----
 drivers/iio/pressure/bmp280.h      |  4 +++-
 4 files changed, 38 insertions(+), 22 deletions(-)


base-commit: 89e2233386a5670d15908628b63e611cb03b0d03
-- 
2.42.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data()
  2023-10-22 17:22 [PATCH v2 0/5] Add support for BMP390 and various driver cleanups Angel Iglesias
@ 2023-10-22 17:22 ` Angel Iglesias
  2023-10-23 11:21   ` Andy Shevchenko
  2023-10-22 17:22 ` [PATCH v2 2/5] iio: pressure: bmp280: Use spi_get_device_match_data() Angel Iglesias
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Angel Iglesias @ 2023-10-22 17:22 UTC (permalink / raw)
  To: linux-iio
  Cc: Biju Das, linux-kernel, Andy Shevchenko, Jonathan Cameron,
	Lars-Peter Clausen, Angel Iglesias, Phil Elwell, Linus Walleij,
	Uwe Kleine-König

From: Biju Das <biju.das.jz@bp.renesas.com>

Replace device_get_match_data() and id lookup for retrieving match data
by i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
index dbe630ad05b5..b3e069730f97 100644
--- a/drivers/iio/pressure/bmp280-i2c.c
+++ b/drivers/iio/pressure/bmp280-i2c.c
@@ -11,9 +11,7 @@ static int bmp280_i2c_probe(struct i2c_client *client)
 	const struct bmp280_chip_info *chip_info;
 	const struct i2c_device_id *id = i2c_client_get_device_id(client);
 
-	chip_info = device_get_match_data(&client->dev);
-	if (!chip_info)
-		chip_info = (const struct bmp280_chip_info *) id->driver_data;
+	chip_info = i2c_get_match_data(client);
 
 	regmap = devm_regmap_init_i2c(client, chip_info->regmap_config);
 	if (IS_ERR(regmap)) {
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 2/5] iio: pressure: bmp280: Use spi_get_device_match_data()
  2023-10-22 17:22 [PATCH v2 0/5] Add support for BMP390 and various driver cleanups Angel Iglesias
  2023-10-22 17:22 ` [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data() Angel Iglesias
@ 2023-10-22 17:22 ` Angel Iglesias
  2023-10-22 17:22 ` [PATCH v2 3/5] iio: pressure: bmp280: Rearrange vars in reverse xmas tree order Angel Iglesias
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Angel Iglesias @ 2023-10-22 17:22 UTC (permalink / raw)
  To: linux-iio
  Cc: Biju Das, linux-kernel, Angel Iglesias, Andy Shevchenko,
	Jonathan Cameron, Lars-Peter Clausen, Phil Elwell, Linus Walleij,
	Uwe Kleine-König

Use the spi_get_device_match_data() helper instead of
device_get_match_data() and the fallback match_id logic.

Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

diff --git a/drivers/iio/pressure/bmp280-spi.c b/drivers/iio/pressure/bmp280-spi.c
index 1dff9bb7c4e9..2eed483a8cc4 100644
--- a/drivers/iio/pressure/bmp280-spi.c
+++ b/drivers/iio/pressure/bmp280-spi.c
@@ -58,9 +58,7 @@ static int bmp280_spi_probe(struct spi_device *spi)
 		return ret;
 	}
 
-	chip_info = device_get_match_data(&spi->dev);
-	if (!chip_info)
-		chip_info = (const struct bmp280_chip_info *) id->driver_data;
+	chip_info = spi_get_device_match_data(spi);
 
 	regmap = devm_regmap_init(&spi->dev,
 				  &bmp280_regmap_bus,
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 3/5] iio: pressure: bmp280: Rearrange vars in reverse xmas tree order
  2023-10-22 17:22 [PATCH v2 0/5] Add support for BMP390 and various driver cleanups Angel Iglesias
  2023-10-22 17:22 ` [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data() Angel Iglesias
  2023-10-22 17:22 ` [PATCH v2 2/5] iio: pressure: bmp280: Use spi_get_device_match_data() Angel Iglesias
@ 2023-10-22 17:22 ` Angel Iglesias
  2023-10-22 17:22 ` [PATCH v2 4/5] iio: pressure: bmp280: Allow multiple chips id per family of devices Angel Iglesias
  2023-10-22 17:22 ` [PATCH v2 5/5] iio: pressure: bmp280: Add support for BMP390 Angel Iglesias
  4 siblings, 0 replies; 12+ messages in thread
From: Angel Iglesias @ 2023-10-22 17:22 UTC (permalink / raw)
  To: linux-iio
  Cc: Biju Das, linux-kernel, Angel Iglesias, Andy Shevchenko,
	Jonathan Cameron, Lars-Peter Clausen, Linus Walleij, Phil Elwell,
	Uwe Kleine-König

Small cleanup reordering local variable declarations following reverse
christmas tree convention.

Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
index b3e069730f97..34e3bc758493 100644
--- a/drivers/iio/pressure/bmp280-i2c.c
+++ b/drivers/iio/pressure/bmp280-i2c.c
@@ -7,9 +7,9 @@
 
 static int bmp280_i2c_probe(struct i2c_client *client)
 {
-	struct regmap *regmap;
-	const struct bmp280_chip_info *chip_info;
 	const struct i2c_device_id *id = i2c_client_get_device_id(client);
+	const struct bmp280_chip_info *chip_info;
+	struct regmap *regmap;
 
 	chip_info = i2c_get_match_data(client);
 
diff --git a/drivers/iio/pressure/bmp280-spi.c b/drivers/iio/pressure/bmp280-spi.c
index 2eed483a8cc4..433d6fac83c4 100644
--- a/drivers/iio/pressure/bmp280-spi.c
+++ b/drivers/iio/pressure/bmp280-spi.c
@@ -14,8 +14,7 @@
 static int bmp280_regmap_spi_write(void *context, const void *data,
                                    size_t count)
 {
-	struct device *dev = context;
-	struct spi_device *spi = to_spi_device(dev);
+	struct spi_device *spi = to_spi_device(context);
 	u8 buf[2];
 
 	memcpy(buf, data, 2);
@@ -31,8 +30,7 @@ static int bmp280_regmap_spi_write(void *context, const void *data,
 static int bmp280_regmap_spi_read(void *context, const void *reg,
                                   size_t reg_size, void *val, size_t val_size)
 {
-	struct device *dev = context;
-	struct spi_device *spi = to_spi_device(dev);
+	struct spi_device *spi = to_spi_device(context);
 
 	return spi_write_then_read(spi, reg, reg_size, val, val_size);
 }
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 4/5] iio: pressure: bmp280: Allow multiple chips id per family of devices
  2023-10-22 17:22 [PATCH v2 0/5] Add support for BMP390 and various driver cleanups Angel Iglesias
                   ` (2 preceding siblings ...)
  2023-10-22 17:22 ` [PATCH v2 3/5] iio: pressure: bmp280: Rearrange vars in reverse xmas tree order Angel Iglesias
@ 2023-10-22 17:22 ` Angel Iglesias
  2023-10-23 11:25   ` Andy Shevchenko
  2023-10-22 17:22 ` [PATCH v2 5/5] iio: pressure: bmp280: Add support for BMP390 Angel Iglesias
  4 siblings, 1 reply; 12+ messages in thread
From: Angel Iglesias @ 2023-10-22 17:22 UTC (permalink / raw)
  To: linux-iio
  Cc: Biju Das, linux-kernel, Angel Iglesias, Jonathan Cameron,
	Lars-Peter Clausen, Andy Shevchenko, Phil Elwell, Linus Walleij,
	Uwe Kleine-König

Improve device detection in certain chip families known to have various
chip ids.
When no known ids match, gives a warning but follows along what device
said on the firmware and tries to configure it.

Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>

diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index a2ef1373a274..deb336781b26 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -794,10 +794,12 @@ static int bmp280_chip_config(struct bmp280_data *data)
 }
 
 static const int bmp280_oversampling_avail[] = { 1, 2, 4, 8, 16 };
+static const u8 bmp280_chip_ids[] = { BMP280_CHIP_ID };
 
 const struct bmp280_chip_info bmp280_chip_info = {
 	.id_reg = BMP280_REG_ID,
-	.chip_id = BMP280_CHIP_ID,
+	.chip_id = bmp280_chip_ids,
+	.num_chip_id = ARRAY_SIZE(bmp280_chip_ids),
 	.regmap_config = &bmp280_regmap_config,
 	.start_up_time = 2000,
 	.channels = bmp280_channels,
@@ -846,9 +848,12 @@ static int bme280_chip_config(struct bmp280_data *data)
 	return bmp280_chip_config(data);
 }
 
+static const u8 bme280_chip_ids[] = { BME280_CHIP_ID };
+
 const struct bmp280_chip_info bme280_chip_info = {
 	.id_reg = BMP280_REG_ID,
-	.chip_id = BME280_CHIP_ID,
+	.chip_id = bme280_chip_ids,
+	.num_chip_id = ARRAY_SIZE(bme280_chip_ids),
 	.regmap_config = &bmp280_regmap_config,
 	.start_up_time = 2000,
 	.channels = bmp280_channels,
@@ -1220,10 +1225,12 @@ static int bmp380_chip_config(struct bmp280_data *data)
 
 static const int bmp380_oversampling_avail[] = { 1, 2, 4, 8, 16, 32 };
 static const int bmp380_iir_filter_coeffs_avail[] = { 1, 2, 4, 8, 16, 32, 64, 128};
+static const u8 bmp380_chip_ids[] = { BMP380_CHIP_ID };
 
 const struct bmp280_chip_info bmp380_chip_info = {
 	.id_reg = BMP380_REG_ID,
-	.chip_id = BMP380_CHIP_ID,
+	.chip_id = bmp380_chip_ids,
+	.num_chip_id = ARRAY_SIZE(bmp380_chip_ids),
 	.regmap_config = &bmp380_regmap_config,
 	.start_up_time = 2000,
 	.channels = bmp380_channels,
@@ -1720,10 +1727,12 @@ static int bmp580_chip_config(struct bmp280_data *data)
 }
 
 static const int bmp580_oversampling_avail[] = { 1, 2, 4, 8, 16, 32, 64, 128 };
+static const u8 bmp580_chip_ids[] = { BMP580_CHIP_ID, BMP580_CHIP_ID_ALT };
 
 const struct bmp280_chip_info bmp580_chip_info = {
 	.id_reg = BMP580_REG_CHIP_ID,
-	.chip_id = BMP580_CHIP_ID,
+	.chip_id = bmp580_chip_ids,
+	.num_chip_id = ARRAY_SIZE(bmp580_chip_ids),
 	.regmap_config = &bmp580_regmap_config,
 	.start_up_time = 2000,
 	.channels = bmp380_channels,
@@ -1983,10 +1992,12 @@ static int bmp180_chip_config(struct bmp280_data *data)
 
 static const int bmp180_oversampling_temp_avail[] = { 1 };
 static const int bmp180_oversampling_press_avail[] = { 1, 2, 4, 8 };
+static const u8 bmp180_chip_ids[] = { BMP180_CHIP_ID };
 
 const struct bmp280_chip_info bmp180_chip_info = {
 	.id_reg = BMP280_REG_ID,
-	.chip_id = BMP180_CHIP_ID,
+	.chip_id = bmp180_chip_ids,
+	.num_chip_id = ARRAY_SIZE(bmp180_chip_ids),
 	.regmap_config = &bmp180_regmap_config,
 	.start_up_time = 2000,
 	.channels = bmp280_channels,
@@ -2077,6 +2088,7 @@ int bmp280_common_probe(struct device *dev,
 	struct bmp280_data *data;
 	struct gpio_desc *gpiod;
 	unsigned int chip_id;
+	unsigned int i;
 	int ret;
 
 	indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
@@ -2142,12 +2154,19 @@ int bmp280_common_probe(struct device *dev,
 	ret = regmap_read(regmap, data->chip_info->id_reg, &chip_id);
 	if (ret < 0)
 		return ret;
-	if (chip_id != data->chip_info->chip_id) {
-		dev_err(dev, "bad chip id: expected %x got %x\n",
-			data->chip_info->chip_id, chip_id);
-		return -EINVAL;
+
+	for (i = 0; i < data->chip_info->num_chip_id; i++) {
+		if (chip_id == data->chip_info->chip_id[i]) {
+			dev_info(dev, "0x%x is a known chip id for %s\n", chip_id, name);
+			break;
+		}
+		dev_warn(dev, "chip id 0x%x does not match known id 0x%x\n",
+			 chip_id, data->chip_info->chip_id[i]);
 	}
 
+	if (i == data->chip_info->num_chip_id)
+		dev_warn(dev, "bad chip id: 0x%x is not a known chip id\n", chip_id);
+
 	if (data->chip_info->preinit) {
 		ret = data->chip_info->preinit(data);
 		if (ret)
diff --git a/drivers/iio/pressure/bmp280.h b/drivers/iio/pressure/bmp280.h
index 5c0563ce7572..a230fcfc4a85 100644
--- a/drivers/iio/pressure/bmp280.h
+++ b/drivers/iio/pressure/bmp280.h
@@ -418,7 +418,8 @@ struct bmp280_data {
 
 struct bmp280_chip_info {
 	unsigned int id_reg;
-	const unsigned int chip_id;
+	const u8 *chip_id;
+	int num_chip_id;
 
 	const struct regmap_config *regmap_config;
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 5/5] iio: pressure: bmp280: Add support for BMP390
  2023-10-22 17:22 [PATCH v2 0/5] Add support for BMP390 and various driver cleanups Angel Iglesias
                   ` (3 preceding siblings ...)
  2023-10-22 17:22 ` [PATCH v2 4/5] iio: pressure: bmp280: Allow multiple chips id per family of devices Angel Iglesias
@ 2023-10-22 17:22 ` Angel Iglesias
  4 siblings, 0 replies; 12+ messages in thread
From: Angel Iglesias @ 2023-10-22 17:22 UTC (permalink / raw)
  To: linux-iio
  Cc: Biju Das, linux-kernel, Angel Iglesias, Jonathan Cameron,
	Lars-Peter Clausen, Andy Shevchenko, Linus Walleij, Phil Elwell,
	Uwe Kleine-König

Add BMP390 device ID to the supported IDs on bmp380 sensor family

Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>

diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index deb336781b26..c6c761e84006 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -13,6 +13,7 @@
  * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf
  * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf
  * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp388-ds001.pdf
+ * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp390-ds002.pdf
  * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp581-ds004.pdf
  *
  * Notice:
@@ -1225,7 +1226,7 @@ static int bmp380_chip_config(struct bmp280_data *data)
 
 static const int bmp380_oversampling_avail[] = { 1, 2, 4, 8, 16, 32 };
 static const int bmp380_iir_filter_coeffs_avail[] = { 1, 2, 4, 8, 16, 32, 64, 128};
-static const u8 bmp380_chip_ids[] = { BMP380_CHIP_ID };
+static const u8 bmp380_chip_ids[] = { BMP380_CHIP_ID, BMP390_CHIP_ID };
 
 const struct bmp280_chip_info bmp380_chip_info = {
 	.id_reg = BMP380_REG_ID,
diff --git a/drivers/iio/pressure/bmp280.h b/drivers/iio/pressure/bmp280.h
index a230fcfc4a85..2971bf58f802 100644
--- a/drivers/iio/pressure/bmp280.h
+++ b/drivers/iio/pressure/bmp280.h
@@ -292,6 +292,7 @@
 #define BMP580_CHIP_ID_ALT		0x51
 #define BMP180_CHIP_ID			0x55
 #define BMP280_CHIP_ID			0x58
+#define BMP390_CHIP_ID			0x60
 #define BME280_CHIP_ID			0x60
 #define BMP280_SOFT_RESET_VAL		0xB6
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data()
  2023-10-22 17:22 ` [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data() Angel Iglesias
@ 2023-10-23 11:21   ` Andy Shevchenko
  2023-10-23 14:00     ` Angel Iglesias
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2023-10-23 11:21 UTC (permalink / raw)
  To: Angel Iglesias
  Cc: linux-iio, Biju Das, linux-kernel, Jonathan Cameron,
	Lars-Peter Clausen, Phil Elwell, Linus Walleij,
	Uwe Kleine-König

On Sun, Oct 22, 2023 at 07:22:17PM +0200, Angel Iglesias wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Replace device_get_match_data() and id lookup for retrieving match data
> by i2c_get_match_data().
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Hmm... What tools have you used to format/send this? It seems differs
to what `git format-patch` does.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 4/5] iio: pressure: bmp280: Allow multiple chips id per family of devices
  2023-10-22 17:22 ` [PATCH v2 4/5] iio: pressure: bmp280: Allow multiple chips id per family of devices Angel Iglesias
@ 2023-10-23 11:25   ` Andy Shevchenko
       [not found]     ` <20231027144234.0ad6c7b6@jic23-huawei>
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2023-10-23 11:25 UTC (permalink / raw)
  To: Angel Iglesias
  Cc: linux-iio, Biju Das, linux-kernel, Jonathan Cameron,
	Lars-Peter Clausen, Phil Elwell, Linus Walleij,
	Uwe Kleine-König

On Sun, Oct 22, 2023 at 07:22:20PM +0200, Angel Iglesias wrote:
> Improve device detection in certain chip families known to have various
> chip ids.
> When no known ids match, gives a warning but follows along what device
> said on the firmware and tries to configure it.

I would rephrase it a bit:

"Improve device detection in certain chip families known to have
various chip IDs. When no ID matches, give a warning but follow
along what device said on the firmware side and try to configure
it."

...

> +	for (i = 0; i < data->chip_info->num_chip_id; i++) {
> +		if (chip_id == data->chip_info->chip_id[i]) {
> +			dev_info(dev, "0x%x is a known chip id for %s\n", chip_id, name);
> +			break;
> +		}

> +		dev_warn(dev, "chip id 0x%x does not match known id 0x%x\n",
> +			 chip_id, data->chip_info->chip_id[i]);

If the matching ID is not the first one, user will have an unneeded warning here.

>  	}

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data()
  2023-10-23 11:21   ` Andy Shevchenko
@ 2023-10-23 14:00     ` Angel Iglesias
  2023-10-23 20:05       ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Angel Iglesias @ 2023-10-23 14:00 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-iio, Biju Das, linux-kernel, Jonathan Cameron,
	Lars-Peter Clausen, Phil Elwell, Linus Walleij,
	Uwe Kleine-König

On Mon, 2023-10-23 at 14:21 +0300, Andy Shevchenko wrote:
> On Sun, Oct 22, 2023 at 07:22:17PM +0200, Angel Iglesias wrote:
> > From: Biju Das <biju.das.jz@bp.renesas.com>
> > 
> > Replace device_get_match_data() and id lookup for retrieving match data
> > by i2c_get_match_data().
> > 
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Hmm... What tools have you used to format/send this? It seems differs
> to what `git format-patch` does.
> 

I just applied this patch from Biju's series with "git am" and then generated
this series running the following invocation:
"git format-patch -v2 -p -n --thread --cover-letter 
--to=linux-iio@vger.kernel.org --base=iio_upstream/togreg HEAD~5"
My work repository is publicly available here:
https://github.com/angiglesias/linux/commits/iio-bmp280-add-bmp390-support

Kind regards,
Angel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data()
  2023-10-23 14:00     ` Angel Iglesias
@ 2023-10-23 20:05       ` Andy Shevchenko
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2023-10-23 20:05 UTC (permalink / raw)
  To: Angel Iglesias
  Cc: linux-iio, Biju Das, linux-kernel, Jonathan Cameron,
	Lars-Peter Clausen, Phil Elwell, Linus Walleij,
	Uwe Kleine-König

On Mon, Oct 23, 2023 at 04:00:53PM +0200, Angel Iglesias wrote:
> On Mon, 2023-10-23 at 14:21 +0300, Andy Shevchenko wrote:
> > On Sun, Oct 22, 2023 at 07:22:17PM +0200, Angel Iglesias wrote:
> > > From: Biju Das <biju.das.jz@bp.renesas.com>
> > > 
> > > Replace device_get_match_data() and id lookup for retrieving match data
> > > by i2c_get_match_data().
> > > 
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > 
> > Hmm... What tools have you used to format/send this? It seems differs
> > to what `git format-patch` does.
> 
> I just applied this patch from Biju's series with "git am" and then generated
> this series running the following invocation:
> "git format-patch -v2 -p -n --thread --cover-letter 
> --to=linux-iio@vger.kernel.org --base=iio_upstream/togreg HEAD~5"
> My work repository is publicly available here:
> https://github.com/angiglesias/linux/commits/iio-bmp280-add-bmp390-support

Somehow the diffstat is stripped off...

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 4/5] iio: pressure: bmp280: Allow multiple chips id per family of devices
       [not found]       ` <20231027144625.36cc694c@jic23-huawei>
@ 2023-10-28 11:23         ` Angel Iglesias
  2023-10-28 13:07           ` Jonathan Cameron
  0 siblings, 1 reply; 12+ messages in thread
From: Angel Iglesias @ 2023-10-28 11:23 UTC (permalink / raw)
  To: Jonathan Cameron, Andy Shevchenko
  Cc: linux-iio, Biju Das, linux-kernel, Lars-Peter Clausen,
	Phil Elwell, Linus Walleij, Uwe Kleine-König

On Fri, 2023-10-27 at 14:46 +0100, Jonathan Cameron wrote:
> On Fri, 27 Oct 2023 14:42:34 +0100
> Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > On Mon, 23 Oct 2023 14:25:42 +0300
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > 
> > > On Sun, Oct 22, 2023 at 07:22:20PM +0200, Angel Iglesias wrote:  
> > > > Improve device detection in certain chip families known to have various
> > > > chip ids.
> > > > When no known ids match, gives a warning but follows along what device
> > > > said on the firmware and tries to configure it.    
> > > 
> > > I would rephrase it a bit:
> > > 
> > > "Improve device detection in certain chip families known to have
> > > various chip IDs. When no ID matches, give a warning but follow
> > > along what device said on the firmware side and try to configure
> > > it."
> > > 
> > > ...
> > >   
> > > > +	for (i = 0; i < data->chip_info->num_chip_id; i++) {
> > > > +		if (chip_id == data->chip_info->chip_id[i]) {
> > > > +			dev_info(dev, "0x%x is a known chip id for
> > > > %s\n", chip_id, name);
> > > > +			break;
> > > > +		}    
> > >   
> > > > +		dev_warn(dev, "chip id 0x%x does not match known id
> > > > 0x%x\n",
> > > > +			 chip_id, data->chip_info->chip_id[i]);    
> > > 
> > > If the matching ID is not the first one, user will have an unneeded
> > > warning here.  
> > 
> > Could be a dev_dbg() but I'd just drop it entirely.
> > 
> Given that was all that came up, I've hopefully saved us all time by
> dropping the bring and changing the patch description as Andy suggested.
> 
> With that done, applied.
> 
> Jonathan
> 

Sorry for the extra work Jonathan. Next time I'll be quicker checking the inbox.

Thanks for your time guys.

Angel

> > 
> > >   
> > > >  	}    
> > >   
> > 
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 4/5] iio: pressure: bmp280: Allow multiple chips id per family of devices
  2023-10-28 11:23         ` Angel Iglesias
@ 2023-10-28 13:07           ` Jonathan Cameron
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2023-10-28 13:07 UTC (permalink / raw)
  To: Angel Iglesias
  Cc: Andy Shevchenko, linux-iio, Biju Das, linux-kernel,
	Lars-Peter Clausen, Phil Elwell, Linus Walleij,
	Uwe Kleine-König

On Sat, 28 Oct 2023 13:23:46 +0200
Angel Iglesias <ang.iglesiasg@gmail.com> wrote:

> On Fri, 2023-10-27 at 14:46 +0100, Jonathan Cameron wrote:
> > On Fri, 27 Oct 2023 14:42:34 +0100
> > Jonathan Cameron <jic23@kernel.org> wrote:
> >   
> > > On Mon, 23 Oct 2023 14:25:42 +0300
> > > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > >   
> > > > On Sun, Oct 22, 2023 at 07:22:20PM +0200, Angel Iglesias wrote:    
> > > > > Improve device detection in certain chip families known to have various
> > > > > chip ids.
> > > > > When no known ids match, gives a warning but follows along what device
> > > > > said on the firmware and tries to configure it.      
> > > > 
> > > > I would rephrase it a bit:
> > > > 
> > > > "Improve device detection in certain chip families known to have
> > > > various chip IDs. When no ID matches, give a warning but follow
> > > > along what device said on the firmware side and try to configure
> > > > it."
> > > > 
> > > > ...
> > > >     
> > > > > +	for (i = 0; i < data->chip_info->num_chip_id; i++) {
> > > > > +		if (chip_id == data->chip_info->chip_id[i]) {
> > > > > +			dev_info(dev, "0x%x is a known chip id for
> > > > > %s\n", chip_id, name);
> > > > > +			break;
> > > > > +		}      
> > > >     
> > > > > +		dev_warn(dev, "chip id 0x%x does not match known id
> > > > > 0x%x\n",
> > > > > +			 chip_id, data->chip_info->chip_id[i]);      
> > > > 
> > > > If the matching ID is not the first one, user will have an unneeded
> > > > warning here.    
> > > 
> > > Could be a dev_dbg() but I'd just drop it entirely.
> > >   
> > Given that was all that came up, I've hopefully saved us all time by
> > dropping the bring and changing the patch description as Andy suggested.
> > 
> > With that done, applied.
> > 
> > Jonathan
> >   
> 
> Sorry for the extra work Jonathan. Next time I'll be quicker checking the inbox.
Don't worry about it!  It's a bit random when I get to IIO stuff these days
so when I do, I like to clear as much as possible out in one go.

J 

> 
> Thanks for your time guys.
> 
> Angel
> 
> > >   
> > > >     
> > > > >  	}      
> > > >     
> > >   
> >   
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-10-28 13:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-22 17:22 [PATCH v2 0/5] Add support for BMP390 and various driver cleanups Angel Iglesias
2023-10-22 17:22 ` [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data() Angel Iglesias
2023-10-23 11:21   ` Andy Shevchenko
2023-10-23 14:00     ` Angel Iglesias
2023-10-23 20:05       ` Andy Shevchenko
2023-10-22 17:22 ` [PATCH v2 2/5] iio: pressure: bmp280: Use spi_get_device_match_data() Angel Iglesias
2023-10-22 17:22 ` [PATCH v2 3/5] iio: pressure: bmp280: Rearrange vars in reverse xmas tree order Angel Iglesias
2023-10-22 17:22 ` [PATCH v2 4/5] iio: pressure: bmp280: Allow multiple chips id per family of devices Angel Iglesias
2023-10-23 11:25   ` Andy Shevchenko
     [not found]     ` <20231027144234.0ad6c7b6@jic23-huawei>
     [not found]       ` <20231027144625.36cc694c@jic23-huawei>
2023-10-28 11:23         ` Angel Iglesias
2023-10-28 13:07           ` Jonathan Cameron
2023-10-22 17:22 ` [PATCH v2 5/5] iio: pressure: bmp280: Add support for BMP390 Angel Iglesias

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.