.get_value = qcom_gpio_get_value,
.set_value = qcom_gpio_set_value,
.get_function = qcom_gpio_get_function,
+ .xlate = qcom_gpio_xlate,
};
-
+ static int qcom_gpio_bind(struct udevice *dev)
+ {
++
+ struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
+ ulong quirks = dev_get_driver_data(dev);
+ struct udevice *child;
+ struct driver *drv;
+ int ret;
+
+ drv = lists_driver_lookup_name("qcom_pmic_pinctrl");
+ if (!drv) {
+ log_warning("Cannot find driver '%s'\n", "qcom_pmic_pinctrl");
+ return -ENOENT;
+ }
+
+ /* Bind the GPIO driver as a child of the PMIC. */
+ ret = device_bind_with_driver_data(dev, drv,
+ dev->name,
+ quirks, dev_ofnode(dev), &child);
+ if (ret)
+ return log_msg_ret("bind", ret);
+
+ dev_set_plat(child, plat);
+
+ return 0;
+ }
+
static int qcom_gpio_probe(struct udevice *dev)
{
- struct qcom_gpio_bank *priv = dev_get_priv(dev);
- int reg;
+ struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
+ struct qcom_pmic_gpio_data *plat = dev_get_plat(dev);
+ struct ofnode_phandle_args args;
+ int val, ret;
u64 pid;
+ plat->pmic = dev->parent;
+
pid = dev_read_addr(dev);
if (pid == FDT_ADDR_T_NONE)
return log_msg_ret("bad address", -EINVAL);