mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
usb: typec: mux: Remove alt mode parameters from the API
The alt mode descriptor parameters are not used anymore. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Tested-by: Bjorn Andersson <andersson@kernel.org> Acked-by: Prashant Malani <pmalani@chromium.org> Link: https://lore.kernel.org/r/20230526131434.46920-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4aebc4f89f
commit
3524fe3153
5 changed files with 10 additions and 18 deletions
|
@ -77,7 +77,7 @@ static int cros_typec_get_switch_handles(struct cros_typec_port *port,
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
port->mux = fwnode_typec_mux_get(fwnode, NULL);
|
port->mux = fwnode_typec_mux_get(fwnode);
|
||||||
if (IS_ERR(port->mux)) {
|
if (IS_ERR(port->mux)) {
|
||||||
ret = PTR_ERR(port->mux);
|
ret = PTR_ERR(port->mux);
|
||||||
dev_dbg(dev, "Mux handle not found: %d.\n", ret);
|
dev_dbg(dev, "Mux handle not found: %d.\n", ret);
|
||||||
|
|
|
@ -369,7 +369,6 @@ static int pmic_glink_altmode_probe(struct auxiliary_device *adev,
|
||||||
{
|
{
|
||||||
struct pmic_glink_altmode_port *alt_port;
|
struct pmic_glink_altmode_port *alt_port;
|
||||||
struct pmic_glink_altmode *altmode;
|
struct pmic_glink_altmode *altmode;
|
||||||
struct typec_altmode_desc mux_desc = {};
|
|
||||||
const struct of_device_id *match;
|
const struct of_device_id *match;
|
||||||
struct fwnode_handle *fwnode;
|
struct fwnode_handle *fwnode;
|
||||||
struct device *dev = &adev->dev;
|
struct device *dev = &adev->dev;
|
||||||
|
@ -427,9 +426,7 @@ static int pmic_glink_altmode_probe(struct auxiliary_device *adev,
|
||||||
alt_port->dp_alt.mode = USB_TYPEC_DP_MODE;
|
alt_port->dp_alt.mode = USB_TYPEC_DP_MODE;
|
||||||
alt_port->dp_alt.active = 1;
|
alt_port->dp_alt.active = 1;
|
||||||
|
|
||||||
mux_desc.svid = USB_TYPEC_DP_SID;
|
alt_port->typec_mux = fwnode_typec_mux_get(fwnode);
|
||||||
mux_desc.mode = USB_TYPEC_DP_MODE;
|
|
||||||
alt_port->typec_mux = fwnode_typec_mux_get(fwnode, &mux_desc);
|
|
||||||
if (IS_ERR(alt_port->typec_mux))
|
if (IS_ERR(alt_port->typec_mux))
|
||||||
return dev_err_probe(dev, PTR_ERR(alt_port->typec_mux),
|
return dev_err_probe(dev, PTR_ERR(alt_port->typec_mux),
|
||||||
"failed to acquire mode-switch for port: %d\n",
|
"failed to acquire mode-switch for port: %d\n",
|
||||||
|
|
|
@ -2110,7 +2110,7 @@ typec_port_register_altmode(struct typec_port *port,
|
||||||
struct typec_mux *mux;
|
struct typec_mux *mux;
|
||||||
struct typec_retimer *retimer;
|
struct typec_retimer *retimer;
|
||||||
|
|
||||||
mux = typec_mux_get(&port->dev, desc);
|
mux = typec_mux_get(&port->dev);
|
||||||
if (IS_ERR(mux))
|
if (IS_ERR(mux))
|
||||||
return ERR_CAST(mux);
|
return ERR_CAST(mux);
|
||||||
|
|
||||||
|
@ -2274,7 +2274,7 @@ struct typec_port *typec_register_port(struct device *parent,
|
||||||
return ERR_PTR(ret);
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
port->mux = typec_mux_get(&port->dev, NULL);
|
port->mux = typec_mux_get(&port->dev);
|
||||||
if (IS_ERR(port->mux)) {
|
if (IS_ERR(port->mux)) {
|
||||||
ret = PTR_ERR(port->mux);
|
ret = PTR_ERR(port->mux);
|
||||||
put_device(&port->dev);
|
put_device(&port->dev);
|
||||||
|
|
|
@ -287,15 +287,13 @@ static void *typec_mux_match(const struct fwnode_handle *fwnode,
|
||||||
/**
|
/**
|
||||||
* fwnode_typec_mux_get - Find USB Type-C Multiplexer
|
* fwnode_typec_mux_get - Find USB Type-C Multiplexer
|
||||||
* @fwnode: The caller device node
|
* @fwnode: The caller device node
|
||||||
* @desc: Alt Mode description
|
|
||||||
*
|
*
|
||||||
* Finds a mux linked to the caller. This function is primarily meant for the
|
* Finds a mux linked to the caller. This function is primarily meant for the
|
||||||
* Type-C drivers. Returns a reference to the mux on success, NULL if no
|
* Type-C drivers. Returns a reference to the mux on success, NULL if no
|
||||||
* matching connection was found, or ERR_PTR(-EPROBE_DEFER) when a connection
|
* matching connection was found, or ERR_PTR(-EPROBE_DEFER) when a connection
|
||||||
* was found but the mux has not been enumerated yet.
|
* was found but the mux has not been enumerated yet.
|
||||||
*/
|
*/
|
||||||
struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode,
|
struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode)
|
||||||
const struct typec_altmode_desc *desc)
|
|
||||||
{
|
{
|
||||||
struct typec_mux_dev *mux_devs[TYPEC_MUX_MAX_DEVS];
|
struct typec_mux_dev *mux_devs[TYPEC_MUX_MAX_DEVS];
|
||||||
struct typec_mux *mux;
|
struct typec_mux *mux;
|
||||||
|
@ -308,7 +306,7 @@ struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode,
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
count = fwnode_connection_find_matches(fwnode, "mode-switch",
|
count = fwnode_connection_find_matches(fwnode, "mode-switch",
|
||||||
(void *)desc, typec_mux_match,
|
NULL, typec_mux_match,
|
||||||
(void **)mux_devs,
|
(void **)mux_devs,
|
||||||
ARRAY_SIZE(mux_devs));
|
ARRAY_SIZE(mux_devs));
|
||||||
if (count <= 0) {
|
if (count <= 0) {
|
||||||
|
|
|
@ -60,8 +60,7 @@ struct typec_mux_desc {
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_TYPEC)
|
#if IS_ENABLED(CONFIG_TYPEC)
|
||||||
|
|
||||||
struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode,
|
struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode);
|
||||||
const struct typec_altmode_desc *desc);
|
|
||||||
void typec_mux_put(struct typec_mux *mux);
|
void typec_mux_put(struct typec_mux *mux);
|
||||||
int typec_mux_set(struct typec_mux *mux, struct typec_mux_state *state);
|
int typec_mux_set(struct typec_mux *mux, struct typec_mux_state *state);
|
||||||
|
|
||||||
|
@ -74,8 +73,7 @@ void *typec_mux_get_drvdata(struct typec_mux_dev *mux);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static inline struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode,
|
static inline struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode);
|
||||||
const struct typec_altmode_desc *desc)
|
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -102,10 +100,9 @@ static inline void *typec_mux_get_drvdata(struct typec_mux_dev *mux)
|
||||||
|
|
||||||
#endif /* CONFIG_TYPEC */
|
#endif /* CONFIG_TYPEC */
|
||||||
|
|
||||||
static inline struct typec_mux *
|
static inline struct typec_mux *typec_mux_get(struct device *dev)
|
||||||
typec_mux_get(struct device *dev, const struct typec_altmode_desc *desc)
|
|
||||||
{
|
{
|
||||||
return fwnode_typec_mux_get(dev_fwnode(dev), desc);
|
return fwnode_typec_mux_get(dev_fwnode(dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __USB_TYPEC_MUX */
|
#endif /* __USB_TYPEC_MUX */
|
||||||
|
|
Loading…
Reference in a new issue