Resolve I2C GPIO bus and address from EM config for multi-card sensors
When multiple add-in cards with the same I2C GPIO expander (such as ADM1266) are
installed across different I2C buses, each chip exports the identical GPIO line
name (e.g. `adm1266-42-PDIO15`), causing global `gpiod_line_find` lookups to
always resolve to the first enumerated `gpiochip`. Additionally, hardcoding a
card's `hal_common_config` (`bus` and `address`) in `gpio_config.textproto`
causes `GpioCollector::Create` to fail at startup when that bus is unpopulated.
- In `GpioCollector::Create`, when an input `GpioConfig` specifies
`i2c_gpio_properties` without a static `hal_common_config`, store it in
`i2c_gpio_templates_` instead of opening the GPIO at startup.
- Parse `"Bus"` and `"Address"` into `GpioSensorConfig::hal_common_config` in
`ParseGpioSensorConfig` and pass it from `GpioSensor` to
`GpioCollector::GetValue`, which populates the template's `hal_common_config`
to lazily instantiate and cache an `OnDemandGpio` per `(gpio_name, bus,
address)`.
- In `internal::FindGpioLine`, when `i2c_gpio_properties` is present, open the
target `gpiochip` by its `<bus>-<addr>` label via `gpiod_chip_open_by_label`
and look up the line within that chip via `gpiod_chip_find_line`.
Google-Bug-Id:550554367
PiperOrigin-RevId: 991016418
Change-Id: Ibd853889983815db03193b6d2c706be46180bac5
1 file changed