]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: pinctrl: Set up itss in the probe() method
authorSimon Glass <sjg@chromium.org>
Wed, 8 Jul 2020 03:32:22 +0000 (21:32 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 17 Jul 2020 06:32:24 +0000 (14:32 +0800)
At present the itss is probed in the ofdata_to_platdata() method. This is
incorrect since itss is a child of p2sb which itself needs to probe the
pinctrl device. This means that p2sb is effectively not probed when the
itss is probed, so we get the wrong register address from p2sb.

Fix this by moving the itss probe to the correct place.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
drivers/pinctrl/intel/pinctrl.c

index 32ca303b2797c6b6ab125d48d6110b755be6e76a..ba21c9dcc2e9d203a263a9c2f8a200f794f46c9c 100644 (file)
@@ -619,15 +619,11 @@ int intel_pinctrl_ofdata_to_platdata(struct udevice *dev,
 {
        struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
        struct intel_pinctrl_priv *priv = dev_get_priv(dev);
-       int ret;
 
        if (!comm) {
                log_err("Cannot find community for pid %d\n", pplat->pid);
                return -EDOM;
        }
-       ret = irq_first_device_type(X86_IRQT_ITSS, &priv->itss);
-       if (ret)
-               return log_msg_ret("Cannot find ITSS", ret);
        priv->comm = comm;
        priv->num_cfgs = num_cfgs;
 
@@ -637,8 +633,12 @@ int intel_pinctrl_ofdata_to_platdata(struct udevice *dev,
 int intel_pinctrl_probe(struct udevice *dev)
 {
        struct intel_pinctrl_priv *priv = dev_get_priv(dev);
+       int ret;
 
        priv->itss_pol_cfg = true;
+       ret = irq_first_device_type(X86_IRQT_ITSS, &priv->itss);
+       if (ret)
+               return log_msg_ret("Cannot find ITSS", ret);
 
        return 0;
 }