Commit b6285149 authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Lee Jones

usb: typec: mux: Convert the Intel PMC Mux driver to use new SCU IPC API

Convert the driver to use the new SCU IPC API. This allows us to get rid
of the duplicate PMC IPC implementation which is now covered in SCU IPC
driver.
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 68c73fb2
...@@ -11,7 +11,7 @@ config TYPEC_MUX_PI3USB30532 ...@@ -11,7 +11,7 @@ config TYPEC_MUX_PI3USB30532
config TYPEC_MUX_INTEL_PMC config TYPEC_MUX_INTEL_PMC
tristate "Intel PMC mux control" tristate "Intel PMC mux control"
depends on INTEL_PMC_IPC depends on INTEL_SCU_IPC
select USB_ROLE_SWITCH select USB_ROLE_SWITCH
help help
Driver for USB muxes controlled by Intel PMC FW. Intel PMC FW can Driver for USB muxes controlled by Intel PMC FW. Intel PMC FW can
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <linux/usb/typec_dp.h> #include <linux/usb/typec_dp.h>
#include <linux/usb/typec_tbt.h> #include <linux/usb/typec_tbt.h>
#include <asm/intel_pmc_ipc.h> #include <asm/intel_scu_ipc.h>
#define PMC_USBC_CMD 0xa7 #define PMC_USBC_CMD 0xa7
...@@ -96,6 +96,7 @@ struct pmc_usb_port { ...@@ -96,6 +96,7 @@ struct pmc_usb_port {
struct pmc_usb { struct pmc_usb {
u8 num_ports; u8 num_ports;
struct device *dev; struct device *dev;
struct intel_scu_ipc_dev *ipc;
struct pmc_usb_port *port; struct pmc_usb_port *port;
}; };
...@@ -107,9 +108,8 @@ static int pmc_usb_command(struct pmc_usb_port *port, u8 *msg, u32 len) ...@@ -107,9 +108,8 @@ static int pmc_usb_command(struct pmc_usb_port *port, u8 *msg, u32 len)
* Error bit will always be 0 with the USBC command. * Error bit will always be 0 with the USBC command.
* Status can be checked from the response message. * Status can be checked from the response message.
*/ */
intel_pmc_ipc_command(PMC_USBC_CMD, 0, msg, len, intel_scu_ipc_dev_command(port->pmc->ipc, PMC_USBC_CMD, 0, msg, len,
(void *)response, 1); response, sizeof(response));
if (response[2]) { if (response[2]) {
if (response[2] & BIT(1)) if (response[2] & BIT(1))
return -EIO; return -EIO;
...@@ -370,6 +370,10 @@ static int pmc_usb_probe(struct platform_device *pdev) ...@@ -370,6 +370,10 @@ static int pmc_usb_probe(struct platform_device *pdev)
if (!pmc->port) if (!pmc->port)
return -ENOMEM; return -ENOMEM;
pmc->ipc = devm_intel_scu_ipc_dev_get(&pdev->dev);
if (!pmc->ipc)
return -ENODEV;
pmc->dev = &pdev->dev; pmc->dev = &pdev->dev;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment