All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Andy Shevchenko
	<andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: MyungJoo Ham
	<myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>,
	Heikki Krogerus
	<heikki.krogerus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Darren Hart <dvhart-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Andy Shevchenko <andy-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Peter Rosin <peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>,
	Mathias Nyman
	<mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Platform Driver
	<platform-driver-x86-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org,
	Kuppuswamy Sathyanarayanan
	<sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Sathyanarayanan Kuppuswamy Natarajan
	<sathyaosid-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	USB <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 11/11] platform/x86: intel_cht_int33fe: Add mux mappings for the Type-C port
Date: Mon, 4 Sep 2017 16:20:35 +0200	[thread overview]
Message-ID: <e1be9239-daff-1f67-dc15-a504acc433a4@redhat.com> (raw)
In-Reply-To: <CAHp75VdFAY6HaOh5-yBsgBoeJgpDrVUizX+zESq1Pr0-sQR6Pg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi,

On 02-09-17 12:42, Andy Shevchenko wrote:
> On Sat, Sep 2, 2017 at 12:48 AM, Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> We need to add mappings for the mux subsys to be able to find the
>> muxes for the fusb302 driver to be able to control the PI3USB30532
>> Type-C mux and the device/host mux integrated in the CHT SoC.
>>
> 
> I suppose it will go via not PDx86 tree,

Hmm, as I just mentioned in the "[PATCH v4 0/3] i2c: Hookup typec power-negotation to the PMIC and charger"
thread I've multiple patches for the intel_cht_int33fe.c driver pending,
so I think it would be best if these were merged through platform/x86,
but that is going to require a merge-tag for the mux stuff so that
that can be merged into platform/x86 as we need some mux/consumer.h
changes.

Anyways lets figure this out as we go along, it is also going to depend
on the timing, if the mux changes land for 4.15 but some of the other
bits don't then this patch (which ties everything together) becomes
4.16 material and we don't need to worry about a merge-tag,

Regards,

Hans



  so
> 
> Acked-by: Andy Shevchenko <andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>



> 
>> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>>   drivers/platform/x86/Kconfig             |  1 +
>>   drivers/platform/x86/intel_cht_int33fe.c | 23 +++++++++++++++++++++++
>>   2 files changed, 24 insertions(+)
>>
>> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
>> index c5554577681a..4256e05ee584 100644
>> --- a/drivers/platform/x86/Kconfig
>> +++ b/drivers/platform/x86/Kconfig
>> @@ -794,6 +794,7 @@ config ACPI_CMPC
>>   config INTEL_CHT_INT33FE
>>          tristate "Intel Cherry Trail ACPI INT33FE Driver"
>>          depends on X86 && ACPI && I2C && REGULATOR
>> +       select MULTIPLEXER
>>          ---help---
>>            This driver add support for the INT33FE ACPI device found on
>>            some Intel Cherry Trail devices.
>> diff --git a/drivers/platform/x86/intel_cht_int33fe.c b/drivers/platform/x86/intel_cht_int33fe.c
>> index 24a1662be81d..611b8af9cefd 100644
>> --- a/drivers/platform/x86/intel_cht_int33fe.c
>> +++ b/drivers/platform/x86/intel_cht_int33fe.c
>> @@ -24,6 +24,7 @@
>>   #include <linux/i2c.h>
>>   #include <linux/interrupt.h>
>>   #include <linux/module.h>
>> +#include <linux/mux/consumer.h>
>>   #include <linux/regulator/consumer.h>
>>   #include <linux/slab.h>
>>
>> @@ -35,6 +36,19 @@ struct cht_int33fe_data {
>>          struct i2c_client *pi3usb30532;
>>   };
>>
>> +static struct mux_lookup cht_int33fe_mux_lookup[] = {
>> +       {
>> +               .provider = "i2c-pi3usb30532",
>> +               .dev_id   = "i2c-fusb302",
>> +               .mux_name = "type-c-mode-mux",
>> +       },
>> +       {
>> +               .provider = "intel_cht_usb_mux",
>> +               .dev_id   = "i2c-fusb302",
>> +               .mux_name = "usb-role-mux",
>> +       },
>> +};
>> +
>>   /*
>>    * Grrr I severly dislike buggy BIOS-es. At least one BIOS enumerates
>>    * the max17047 both through the INT33FE ACPI device (it is right there
>> @@ -170,6 +184,9 @@ static int cht_int33fe_probe(struct i2c_client *client)
>>          board_info.properties = fusb302_props;
>>          board_info.irq = fusb302_irq;
>>
>> +       mux_add_table(cht_int33fe_mux_lookup,
>> +                     ARRAY_SIZE(cht_int33fe_mux_lookup));
>> +
>>          data->fusb302 = i2c_acpi_new_device(dev, 2, &board_info);
>>          if (!data->fusb302)
>>                  goto out_unregister_max17047;
>> @@ -193,6 +210,9 @@ static int cht_int33fe_probe(struct i2c_client *client)
>>          if (data->max17047)
>>                  i2c_unregister_device(data->max17047);
>>
>> +       mux_remove_table(cht_int33fe_mux_lookup,
>> +                     ARRAY_SIZE(cht_int33fe_mux_lookup));
>> +
>>          return -EPROBE_DEFER; /* Wait for the i2c-adapter to load */
>>   }
>>
>> @@ -205,6 +225,9 @@ static int cht_int33fe_remove(struct i2c_client *i2c)
>>          if (data->max17047)
>>                  i2c_unregister_device(data->max17047);
>>
>> +       mux_remove_table(cht_int33fe_mux_lookup,
>> +                     ARRAY_SIZE(cht_int33fe_mux_lookup));
>> +
>>          return 0;
>>   }
>>
>> --
>> 2.13.5
>>
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	Peter Rosin <peda@axentia.se>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	devel@driverdev.osuosl.org,
	Kuppuswamy Sathyanarayanan 
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	Sathyanarayanan Kuppuswamy Natarajan <sathyaosid@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	USB <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 11/11] platform/x86: intel_cht_int33fe: Add mux mappings for the Type-C port
Date: Mon, 4 Sep 2017 16:20:35 +0200	[thread overview]
Message-ID: <e1be9239-daff-1f67-dc15-a504acc433a4@redhat.com> (raw)
In-Reply-To: <CAHp75VdFAY6HaOh5-yBsgBoeJgpDrVUizX+zESq1Pr0-sQR6Pg@mail.gmail.com>

Hi,

On 02-09-17 12:42, Andy Shevchenko wrote:
> On Sat, Sep 2, 2017 at 12:48 AM, Hans de Goede <hdegoede@redhat.com> wrote:
>> We need to add mappings for the mux subsys to be able to find the
>> muxes for the fusb302 driver to be able to control the PI3USB30532
>> Type-C mux and the device/host mux integrated in the CHT SoC.
>>
> 
> I suppose it will go via not PDx86 tree,

Hmm, as I just mentioned in the "[PATCH v4 0/3] i2c: Hookup typec power-negotation to the PMIC and charger"
thread I've multiple patches for the intel_cht_int33fe.c driver pending,
so I think it would be best if these were merged through platform/x86,
but that is going to require a merge-tag for the mux stuff so that
that can be merged into platform/x86 as we need some mux/consumer.h
changes.

Anyways lets figure this out as we go along, it is also going to depend
on the timing, if the mux changes land for 4.15 but some of the other
bits don't then this patch (which ties everything together) becomes
4.16 material and we don't need to worry about a merge-tag,

Regards,

Hans



  so
> 
> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>



> 
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   drivers/platform/x86/Kconfig             |  1 +
>>   drivers/platform/x86/intel_cht_int33fe.c | 23 +++++++++++++++++++++++
>>   2 files changed, 24 insertions(+)
>>
>> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
>> index c5554577681a..4256e05ee584 100644
>> --- a/drivers/platform/x86/Kconfig
>> +++ b/drivers/platform/x86/Kconfig
>> @@ -794,6 +794,7 @@ config ACPI_CMPC
>>   config INTEL_CHT_INT33FE
>>          tristate "Intel Cherry Trail ACPI INT33FE Driver"
>>          depends on X86 && ACPI && I2C && REGULATOR
>> +       select MULTIPLEXER
>>          ---help---
>>            This driver add support for the INT33FE ACPI device found on
>>            some Intel Cherry Trail devices.
>> diff --git a/drivers/platform/x86/intel_cht_int33fe.c b/drivers/platform/x86/intel_cht_int33fe.c
>> index 24a1662be81d..611b8af9cefd 100644
>> --- a/drivers/platform/x86/intel_cht_int33fe.c
>> +++ b/drivers/platform/x86/intel_cht_int33fe.c
>> @@ -24,6 +24,7 @@
>>   #include <linux/i2c.h>
>>   #include <linux/interrupt.h>
>>   #include <linux/module.h>
>> +#include <linux/mux/consumer.h>
>>   #include <linux/regulator/consumer.h>
>>   #include <linux/slab.h>
>>
>> @@ -35,6 +36,19 @@ struct cht_int33fe_data {
>>          struct i2c_client *pi3usb30532;
>>   };
>>
>> +static struct mux_lookup cht_int33fe_mux_lookup[] = {
>> +       {
>> +               .provider = "i2c-pi3usb30532",
>> +               .dev_id   = "i2c-fusb302",
>> +               .mux_name = "type-c-mode-mux",
>> +       },
>> +       {
>> +               .provider = "intel_cht_usb_mux",
>> +               .dev_id   = "i2c-fusb302",
>> +               .mux_name = "usb-role-mux",
>> +       },
>> +};
>> +
>>   /*
>>    * Grrr I severly dislike buggy BIOS-es. At least one BIOS enumerates
>>    * the max17047 both through the INT33FE ACPI device (it is right there
>> @@ -170,6 +184,9 @@ static int cht_int33fe_probe(struct i2c_client *client)
>>          board_info.properties = fusb302_props;
>>          board_info.irq = fusb302_irq;
>>
>> +       mux_add_table(cht_int33fe_mux_lookup,
>> +                     ARRAY_SIZE(cht_int33fe_mux_lookup));
>> +
>>          data->fusb302 = i2c_acpi_new_device(dev, 2, &board_info);
>>          if (!data->fusb302)
>>                  goto out_unregister_max17047;
>> @@ -193,6 +210,9 @@ static int cht_int33fe_probe(struct i2c_client *client)
>>          if (data->max17047)
>>                  i2c_unregister_device(data->max17047);
>>
>> +       mux_remove_table(cht_int33fe_mux_lookup,
>> +                     ARRAY_SIZE(cht_int33fe_mux_lookup));
>> +
>>          return -EPROBE_DEFER; /* Wait for the i2c-adapter to load */
>>   }
>>
>> @@ -205,6 +225,9 @@ static int cht_int33fe_remove(struct i2c_client *i2c)
>>          if (data->max17047)
>>                  i2c_unregister_device(data->max17047);
>>
>> +       mux_remove_table(cht_int33fe_mux_lookup,
>> +                     ARRAY_SIZE(cht_int33fe_mux_lookup));
>> +
>>          return 0;
>>   }
>>
>> --
>> 2.13.5
>>
> 
> 
> 

  parent reply	other threads:[~2017-09-04 14:20 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01 21:48 [PATCH 00/11] mux/typec: Add USB / TypeC mux drivers and hook them up on some x86 systems Hans de Goede
2017-09-01 21:48 ` [PATCH 01/11] mux: core: Add of_mux_control_get helper function Hans de Goede
2017-09-01 21:48 ` [PATCH 02/11] mux: core: Add support for getting a mux controller on a non DT platform Hans de Goede
2017-09-01 21:48   ` Hans de Goede
2017-09-02 19:13   ` sathya
2017-09-04 14:21     ` Hans de Goede
2017-09-04 11:19   ` Peter Rosin
     [not found]     ` <0c882d23-d008-3d61-27be-3fa22bf59521-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2017-09-05 10:58       ` Hans de Goede
2017-09-05 10:58         ` Hans de Goede
2017-09-01 21:48 ` [PATCH 03/11] mux: consumer.h: Add MUX_USB_* state constant defines Hans de Goede
2017-09-01 21:48   ` Hans de Goede
2017-09-02 10:10   ` Andy Shevchenko
2017-09-02 11:59     ` Hans de Goede
2017-09-02 14:59   ` Guenter Roeck
2017-09-02 14:59     ` Guenter Roeck
2017-09-02 15:59     ` Hans de Goede
     [not found]       ` <3e777501-aa94-70ae-3dc5-f64a15fd9704-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-09-02 19:06         ` Guenter Roeck
2017-09-02 19:06           ` Guenter Roeck
2017-09-02 19:46           ` Hans de Goede
2017-09-01 21:48 ` [PATCH 04/11] usb: xhci: Add Intel cherrytrail extended cap / otg phy mux handling Hans de Goede
2017-09-01 21:48   ` Hans de Goede
2017-09-04  7:31   ` Heikki Krogerus
2017-09-05 10:06     ` Hans de Goede
2017-09-01 21:48 ` [PATCH 05/11] mux: Add Intel Cherrytrail USB mux driver Hans de Goede
     [not found]   ` <20170901214845.7153-6-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-09-02 10:19     ` Andy Shevchenko
2017-09-02 10:19       ` Andy Shevchenko
2017-09-02 10:37       ` Dan Carpenter
2017-09-04 14:07       ` Hans de Goede
2017-09-04 11:19   ` Peter Rosin
2017-09-05 11:09     ` Hans de Goede
2017-09-05 11:09       ` Hans de Goede
2017-09-01 21:48 ` [PATCH 06/11] mux: Add Pericom PI3USB30532 Type-C " Hans de Goede
2017-09-01 21:48   ` Hans de Goede
2017-09-04 11:19   ` Peter Rosin
2017-09-05  7:46     ` Peter Rosin
2017-09-01 21:48 ` [PATCH 07/11] extcon: intel-int3496: Add support for controlling the USB-role mux Hans de Goede
2017-09-01 21:48   ` Hans de Goede
2017-09-02 10:39   ` Andy Shevchenko
2017-09-02 10:39     ` Andy Shevchenko
2017-09-04 14:11     ` Hans de Goede
2017-09-01 21:48 ` [PATCH 08/11] staging: typec: tcpm: Set mux to device mode when configured as such Hans de Goede
2017-09-01 21:48 ` [PATCH 09/11] staging: typec: Add Generic TCPC mux driver using the mux subsys Hans de Goede
2017-09-01 21:48   ` Hans de Goede
2017-09-01 21:48 ` [PATCH 10/11] staging: typec: fusb302: Hook up mux support using tcpc_gen_mux support Hans de Goede
2017-09-01 21:48   ` Hans de Goede
2017-09-01 21:48 ` [PATCH 11/11] platform/x86: intel_cht_int33fe: Add mux mappings for the Type-C port Hans de Goede
2017-09-01 21:48   ` Hans de Goede
2017-09-02 10:42   ` Andy Shevchenko
     [not found]     ` <CAHp75VdFAY6HaOh5-yBsgBoeJgpDrVUizX+zESq1Pr0-sQR6Pg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-04 14:20       ` Hans de Goede [this message]
2017-09-04 14:20         ` Hans de Goede
2017-09-04 11:18 ` [PATCH 00/11] mux/typec: Add USB / TypeC mux drivers and hook them up on some x86 systems Peter Rosin
2017-09-05 10:54   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1be9239-daff-1f67-dc15-a504acc433a4@redhat.com \
    --to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=andy-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org \
    --cc=dvhart-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=heikki.krogerus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org \
    --cc=platform-driver-x86-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=sathyaosid-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.