#include <fdtdec.h>
#include <errno.h>
#include <dm.h>
-#include <dm/device_compat.h>
#include <i2c.h>
-#include <linux/err.h>
#include <log.h>
#include <asm/global_data.h>
-#include <asm-generic/gpio.h>
#include <linux/printk.h>
#include <power/pmic.h>
#include <power/regulator.h>
{ },
};
-struct pca9450_priv {
- struct gpio_desc *sd_vsel_gpio;
-};
-
static int pca9450_reg_count(struct udevice *dev)
{
return PCA9450_REG_NUM;
static int pca9450_probe(struct udevice *dev)
{
- struct pca9450_priv *priv = dev_get_priv(dev);
unsigned int reset_ctrl;
- int ret = 0;
-
- if (CONFIG_IS_ENABLED(DM_GPIO) && CONFIG_IS_ENABLED(DM_REGULATOR_PCA9450)) {
- priv->sd_vsel_gpio = devm_gpiod_get_optional(dev, "sd-vsel",
- GPIOD_IS_OUT |
- GPIOD_IS_OUT_ACTIVE);
- if (IS_ERR(priv->sd_vsel_gpio)) {
- ret = PTR_ERR(priv->sd_vsel_gpio);
- dev_err(dev, "Failed to request SD_VSEL GPIO: %d\n", ret);
- if (ret)
- return ret;
- }
- }
if (ofnode_read_bool(dev_ofnode(dev), "nxp,wdog_b-warm-reset"))
reset_ctrl = PCA9450_PMIC_RESET_WDOG_B_CFG_WARM;
.bind = pca9450_bind,
.probe = pca9450_probe,
.ops = &pca9450_ops,
- .priv_auto = sizeof(struct pca9450_priv),
};