}
#endif
+static int rk808_probe(struct udevice *dev)
+{
+ struct rk808_priv *priv = dev_get_priv(dev);
+ uint8_t msb, lsb;
+
+ /* read Chip variant */
+ rk808_read(dev, ID_MSB, &msb, 1);
+ rk808_read(dev, ID_LSB, &lsb, 1);
+
+ priv->variant = ((msb << 8) | lsb) & RK8XX_ID_MSK;
+
+ return 0;
+}
+
static struct dm_pmic_ops rk808_ops = {
.reg_count = rk808_reg_count,
.read = rk808_read,
static const struct udevice_id rk808_ids[] = {
{ .compatible = "rockchip,rk808" },
+ { .compatible = "rockchip,rk818" },
{ }
};
#if CONFIG_IS_ENABLED(PMIC_CHILDREN)
.bind = rk808_bind,
#endif
+ .probe = rk808_probe,
.ops = &rk808_ops,
};
RK808_NUM_OF_REGS,
};
+enum {
+ RK805_ID = 0x8050,
+ RK808_ID = 0x0000,
+ RK818_ID = 0x8180,
+};
+
+#define RK8XX_ID_MSK 0xfff0
+
struct rk808_reg_table {
char *name;
u8 reg_ctl;
u8 reg_vol;
};
+struct rk808_priv {
+ int variant;
+};
+
int rk808_spl_configure_buck(struct udevice *pmic, int buck, int uvolt);
#endif