Re: [PATCH 4.18 REGRESSION fix 2/2] i2c-cht-wc: Fix bq24190 supplier

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

 



Hi,

On 02-07-18 12:34, Adam Thomson wrote:
On 01 July 2018 10:49, Hans de Goede wrote:

Commit f2a8aa053c17 ("typec: tcpm: Represent source supply through
power_supply") moved the code to register a power_supply representing
the device supplying power to the type-C connector, from the fusb302
code to the generic tcpm code.

This has caused the power-supply registered by the fusb302 driver,
which determines how much current the bq24190 can draw, to change name
from "fusb302-typec-source" to "tcpm-source-psy-i2c-fusb302".

Fixes: f2a8aa053c17 ("typec: tcpm: Represent source supply through...")
Cc: Adam Thomson <Adam.Thomson.Opensource@xxxxxxxxxxx>
Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
  drivers/i2c/busses/i2c-cht-wc.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c
index 44cffad43701..c4d176f5ed79 100644
--- a/drivers/i2c/busses/i2c-cht-wc.c
+++ b/drivers/i2c/busses/i2c-cht-wc.c
@@ -234,7 +234,8 @@ static const struct irq_chip cht_wc_i2c_irq_chip = {
  	.name			= "cht_wc_ext_chrg_irq_chip",
  };

-static const char * const bq24190_suppliers[] = { "fusb302-typec-source" };
+static const char * const bq24190_suppliers[] = {
+	"tcpm-source-psy-i2c-fusb302" };

In the TCPM code, the psy name is a combination of a fixed prefix
'tcpm-source-psy-' and the dev_name of the port controller to ensure we can
handle multiple fusb302 devices in one system. Is this hard coded name here
going to work for all uses of this driver?

The i2c-cht-wc.c driver only instantiates a client for the bq24190 if
the ACPI INT33FE device is present:

        if (acpi_dev_present("INT33FE", NULL, -1)) {
                board_info.irq = adap->client_irq;
                adap->client = i2c_new_device(&adap->adapter, &board_info);

And the fusb302 boards with the INT33FE device is instantiated
by drivers/platform/x86/intel_cht_int33fe.c which sets i2c_board_info.dev_name
to "fusb302" when instantiating it, these boards are kinda special and we
need to manually instantiate multiple i2c devices on them, so hardcoding things
here is pretty much the only way to deal with this (and note that the name
was hardcoded before too).

Regards,

Hans





  static const struct property_entry bq24190_props[] = {
  	PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_suppliers),
--
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux