@@ -55,6 +55,27 @@ static u32 i2c_demux_functionality(struct i2c_adapter *adap)
return parent->algo->functionality(parent);
}
+static int dbg_show(const char *prefix, struct i2c_demux_pinctrl_priv *priv)
+{
+ int i;
+
+ for (i = 0; i < priv->num_chan; i++) {
+ struct device_node *np;
+ const char *statename;
+ int ret;
+
+ np = priv->chan[i].parent_np;
+
+ ret = of_property_read_string_index(np, "pinctrl-names",
+ 0, &statename);
+ if (ret)
+ statename = "<error>";
+ dev_err(priv->dev, "%s chan:%d bus_name:%s np->full_name:%s "
+ "np:%p statename:%s\n", prefix, i, priv->bus_name,
+ np->full_name, np, statename);
+ }
+}
+
static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 new_chan)
{
struct i2c_adapter *adap;
@@ -99,6 +120,7 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne
if (ret < 0)
goto err_with_put;
+ dbg_show(__func__, priv);
return 0;
err_with_put:
@@ -115,6 +137,8 @@ static int i2c_demux_deactivate_master(struct i2c_demux_pinctrl_priv *priv)
if (cur < 0)
return 0;
+ dbg_show(__func__, priv);
+
i2c_del_adapter(&priv->cur_adap);
i2c_put_adapter(priv->chan[cur].parent_adap);