From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: 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>
Cc: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
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>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH v2 11/11] platform/x86: intel_cht_int33fe: Add mux mappings for the Type-C port
Date: Tue, 5 Sep 2017 18:42:21 +0200 [thread overview]
Message-ID: <20170905164221.11266-12-hdegoede@redhat.com> (raw)
In-Reply-To: <20170905164221.11266-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
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.
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Acked-by: Andy Shevchenko <andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@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 312d2472b8b3..830ff8d0a1eb 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 b2925d996613..89ba510dac78 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
@@ -177,6 +191,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;
@@ -200,6 +217,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 */
}
@@ -212,6 +232,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
prev parent reply other threads:[~2017-09-05 16:42 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 16:42 [PATCH v2 00/11] mux/typec: Add USB / TypeC mux drivers and hook them up on some x86 systems Hans de Goede
2017-09-05 16:42 ` [PATCH v2 02/11] mux: core: Add support for getting a mux controller on a non DT platform Hans de Goede
2017-09-05 16:42 ` [PATCH v2 03/11] mux: core: Add usb.h header with MUX_USB_* and and MUX_TYPEC_* state constants Hans de Goede
2017-09-08 15:47 ` Peter Rosin
2017-09-08 17:07 ` Hans de Goede
2017-09-10 21:36 ` Peter Rosin
2017-09-21 12:07 ` Hans de Goede
2017-09-05 16:42 ` [PATCH v2 04/11] usb: xhci: Add Intel cherrytrail extended cap / otg phy mux handling Hans de Goede
2017-09-07 13:14 ` Mathias Nyman
[not found] ` <59B14628.5030700-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-09-07 15:49 ` Hans de Goede
2017-09-19 12:40 ` Mathias Nyman
2017-09-21 11:55 ` Hans de Goede
2017-09-08 15:47 ` Peter Rosin
2017-09-05 16:42 ` [PATCH v2 05/11] mux: Add Intel Cherrytrail USB mux driver Hans de Goede
2017-09-08 15:45 ` Peter Rosin
2017-09-08 15:45 ` [PATCH 1/2] mux: add mux_control_get_optional() API Peter Rosin
2017-09-08 15:54 ` Peter Rosin
2017-09-19 18:35 ` Hans de Goede
2017-09-20 16:11 ` Stephen Boyd
2017-09-08 15:45 ` [PATCH 2/2] mux: add explicit hook to leave the mux as-is on init/registration Peter Rosin
[not found] ` <20170908154514.4463-1-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2017-09-19 16:38 ` [PATCH v2 05/11] mux: Add Intel Cherrytrail USB mux driver Hans de Goede
2017-09-05 16:42 ` [PATCH v2 06/11] mux: Add Pericom PI3USB30532 Type-C " Hans de Goede
2017-09-05 16:42 ` [PATCH v2 08/11] staging: typec: tcpm: Set mux to device mode when configured as such Hans de Goede
2017-09-10 22:56 ` Guenter Roeck
2017-09-22 14:02 ` Hans de Goede
2017-09-05 16:42 ` [PATCH v2 09/11] staging: typec: Add Generic TCPC mux driver using the mux subsys Hans de Goede
2017-09-05 16:42 ` [PATCH v2 10/11] staging: typec: fusb302: Hook up mux support using tcpc_gen_mux support Hans de Goede
[not found] ` <20170905164221.11266-11-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-09-12 22:20 ` Rob Herring
2017-09-13 8:56 ` Hans de Goede
2017-09-13 13:38 ` Rob Herring
2017-09-13 14:06 ` Hans de Goede
2017-09-13 15:07 ` Rob Herring
[not found] ` <e442bb48-a038-4e2e-6950-4220e28692d3@redhat.com>
[not found] ` <e442bb48-a038-4e2e-6950-4220e28692d3-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-09-13 16:17 ` Guenter Roeck
2017-09-25 10:34 ` Peter Rosin
2017-09-25 11:35 ` Hans de Goede
2017-09-25 13:45 ` Peter Rosin
2017-09-25 14:17 ` Hans de Goede
[not found] ` <20170905164221.11266-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-09-05 16:42 ` [PATCH v2 01/11] mux: core: Add of_mux_control_get helper function Hans de Goede
2017-09-05 16:42 ` [PATCH v2 07/11] extcon: intel-int3496: Add support for controlling the USB-role mux Hans de Goede
2017-09-05 16:42 ` Hans de Goede [this message]
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=20170905164221.11266-12-hdegoede@redhat.com \
--to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=andy-wEGCiKHe2LqWVfeAwA7xHQ@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox