Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753776AbdIDOUm (ORCPT ); Mon, 4 Sep 2017 10:20:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46084 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753686AbdIDOUk (ORCPT ); Mon, 4 Sep 2017 10:20:40 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 54D932C9765 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=hdegoede@redhat.com Subject: Re: [PATCH 11/11] platform/x86: intel_cht_int33fe: Add mux mappings for the Type-C port To: Andy Shevchenko Cc: MyungJoo Ham , Chanwoo Choi , Guenter Roeck , Heikki Krogerus , Darren Hart , Andy Shevchenko , Peter Rosin , Mathias Nyman , Platform Driver , devel@driverdev.osuosl.org, Kuppuswamy Sathyanarayanan , Sathyanarayanan Kuppuswamy Natarajan , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , USB References: <20170901214845.7153-1-hdegoede@redhat.com> <20170901214845.7153-12-hdegoede@redhat.com> From: Hans de Goede Message-ID: Date: Mon, 4 Sep 2017 16:20:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 04 Sep 2017 14:20:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4237 Lines: 122 Hi, On 02-09-17 12:42, Andy Shevchenko wrote: > On Sat, Sep 2, 2017 at 12:48 AM, Hans de Goede 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 > >> Signed-off-by: Hans de Goede >> --- >> 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 >> #include >> #include >> +#include >> #include >> #include >> >> @@ -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 >> > > >