Linux IIO development
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: gyro: bmg160: Improve BMG160 driver with of_match_table support
@ 2025-02-19 15:02 Jun Yan
  2025-02-19 15:02 ` [PATCH 1/2] iio: gyro: bmg160_spi: add of_match_table Jun Yan
  2025-02-19 15:02 ` [PATCH 2/2] iio: gyro: bmg160_i2c: add BMI088 to of_match_table Jun Yan
  0 siblings, 2 replies; 4+ messages in thread
From: Jun Yan @ 2025-02-19 15:02 UTC (permalink / raw)
  To: jic23; +Cc: lars, linux-iio, linux-kernel, Jun Yan

This patch set enhances BMG160 gyro driver and improve device-tree compatibility.

Jun Yan (2):
  iio: gyro: bmg160_spi: add of_match_table
  iio: gyro: bmg160_i2c: add BMI088 to of_match_table

 drivers/iio/gyro/bmg160_i2c.c |  1 +
 drivers/iio/gyro/bmg160_spi.c | 10 ++++++++++
 2 files changed, 11 insertions(+)

-- 
2.48.1


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

* [PATCH 1/2] iio: gyro: bmg160_spi: add of_match_table
  2025-02-19 15:02 [PATCH 0/2] iio: gyro: bmg160: Improve BMG160 driver with of_match_table support Jun Yan
@ 2025-02-19 15:02 ` Jun Yan
  2025-02-20 17:16   ` kernel test robot
  2025-02-19 15:02 ` [PATCH 2/2] iio: gyro: bmg160_i2c: add BMI088 to of_match_table Jun Yan
  1 sibling, 1 reply; 4+ messages in thread
From: Jun Yan @ 2025-02-19 15:02 UTC (permalink / raw)
  To: jic23; +Cc: lars, linux-iio, linux-kernel, Jun Yan

Add of_match_table to bmg160_spi driver.

This fixes automatic driver loading by userspace
When using the device tree and the driver is built
as a module, devices can be probed.

Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
---
 drivers/iio/gyro/bmg160_spi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/iio/gyro/bmg160_spi.c b/drivers/iio/gyro/bmg160_spi.c
index fc2e453527b9..dd33b10dc1b3 100644
--- a/drivers/iio/gyro/bmg160_spi.c
+++ b/drivers/iio/gyro/bmg160_spi.c
@@ -41,9 +41,19 @@ static const struct spi_device_id bmg160_spi_id[] = {
 
 MODULE_DEVICE_TABLE(spi, bmg160_spi_id);
 
+static const struct of_device_id bmg160_of_match[] = {
+        { .compatible = "bosch,bmg160" },
+        { .compatible = "bosch,bmi055_gyro" },
+        { .compatible = "bosch,bmi088_gyro" },
+        { }
+};
+
+MODULE_DEVICE_TABLE(of, bmg160_of_match);
+
 static struct spi_driver bmg160_spi_driver = {
 	.driver = {
 		.name	= "bmg160_spi",
+		.of_match_table = bmg160_of_match
 		.pm	= &bmg160_pm_ops,
 	},
 	.probe		= bmg160_spi_probe,
-- 
2.48.1


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

* [PATCH 2/2] iio: gyro: bmg160_i2c: add BMI088 to of_match_table
  2025-02-19 15:02 [PATCH 0/2] iio: gyro: bmg160: Improve BMG160 driver with of_match_table support Jun Yan
  2025-02-19 15:02 ` [PATCH 1/2] iio: gyro: bmg160_spi: add of_match_table Jun Yan
@ 2025-02-19 15:02 ` Jun Yan
  1 sibling, 0 replies; 4+ messages in thread
From: Jun Yan @ 2025-02-19 15:02 UTC (permalink / raw)
  To: jic23; +Cc: lars, linux-iio, linux-kernel, Jun Yan

BMI088 is missing from the of_match_table. Let's complete it.

Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
---
 drivers/iio/gyro/bmg160_i2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c
index 9c5d7e8ee99c..e6caab49f98a 100644
--- a/drivers/iio/gyro/bmg160_i2c.c
+++ b/drivers/iio/gyro/bmg160_i2c.c
@@ -58,6 +58,7 @@ MODULE_DEVICE_TABLE(i2c, bmg160_i2c_id);
 static const struct of_device_id bmg160_of_match[] = {
 	{ .compatible = "bosch,bmg160" },
 	{ .compatible = "bosch,bmi055_gyro" },
+	{ .compatible = "bosch,bmi088_gyro" },
 	{ }
 };
 
-- 
2.48.1


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

* Re: [PATCH 1/2] iio: gyro: bmg160_spi: add of_match_table
  2025-02-19 15:02 ` [PATCH 1/2] iio: gyro: bmg160_spi: add of_match_table Jun Yan
@ 2025-02-20 17:16   ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-02-20 17:16 UTC (permalink / raw)
  To: Jun Yan, jic23
  Cc: llvm, oe-kbuild-all, lars, linux-iio, linux-kernel, Jun Yan

Hi Jun,

kernel test robot noticed the following build errors:

[auto build test ERROR on jic23-iio/togreg]
[also build test ERROR on linus/master v6.14-rc3 next-20250220]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jun-Yan/iio-gyro-bmg160_spi-add-of_match_table/20250219-231024
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20250219150254.24664-2-jerrysteve1101%40gmail.com
patch subject: [PATCH 1/2] iio: gyro: bmg160_spi: add of_match_table
config: i386-buildonly-randconfig-005-20250220 (https://download.01.org/0day-ci/archive/20250221/202502210125.5IaR1YAL-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250221/202502210125.5IaR1YAL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502210125.5IaR1YAL-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/iio/gyro/bmg160_spi.c:57:3: error: member reference base type 'const struct of_device_id[4]' is not a structure or union
      56 |                 .of_match_table = bmg160_of_match
         |                                   ~~~~~~~~~~~~~~~
      57 |                 .pm     = &bmg160_pm_ops,
         |                 ^~~
   1 error generated.


vim +57 drivers/iio/gyro/bmg160_spi.c

c266686477490d Jun Yan                   2025-02-19  52  
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  53  static struct spi_driver bmg160_spi_driver = {
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  54  	.driver = {
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  55  		.name	= "bmg160_spi",
c266686477490d Jun Yan                   2025-02-19  56  		.of_match_table = bmg160_of_match
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19 @57  		.pm	= &bmg160_pm_ops,
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  58  	},
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  59  	.probe		= bmg160_spi_probe,
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  60  	.remove		= bmg160_spi_remove,
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  61  	.id_table	= bmg160_spi_id,
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  62  };
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  63  module_spi_driver(bmg160_spi_driver);
b1d125cc623639 Markus Schneider-Pargmann 2015-08-19  64  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2025-02-20 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-19 15:02 [PATCH 0/2] iio: gyro: bmg160: Improve BMG160 driver with of_match_table support Jun Yan
2025-02-19 15:02 ` [PATCH 1/2] iio: gyro: bmg160_spi: add of_match_table Jun Yan
2025-02-20 17:16   ` kernel test robot
2025-02-19 15:02 ` [PATCH 2/2] iio: gyro: bmg160_i2c: add BMI088 to of_match_table Jun Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox