mirror of
https://xff.cz/git/u-boot/
synced 2025-09-28 22:11:16 +02:00
pmic: Add support for setting transmission length in uclass private data
The struct uc_pmic_priv's trans_len field stores the number of types to be transmitted per PMIC transfer. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Stefano Babic
parent
9a84116b31
commit
b8a6d6777b
@@ -165,7 +165,17 @@ int pmic_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set)
|
|||||||
return pmic_reg_write(dev, reg, byte);
|
return pmic_reg_write(dev, reg, byte);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int pmic_pre_probe(struct udevice *dev)
|
||||||
|
{
|
||||||
|
struct uc_pmic_priv *pmic_priv = dev_get_uclass_priv(dev);
|
||||||
|
|
||||||
|
pmic_priv->trans_len = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
UCLASS_DRIVER(pmic) = {
|
UCLASS_DRIVER(pmic) = {
|
||||||
.id = UCLASS_PMIC,
|
.id = UCLASS_PMIC,
|
||||||
.name = "pmic",
|
.name = "pmic",
|
||||||
|
.pre_probe = pmic_pre_probe,
|
||||||
|
.per_device_auto_alloc_size = sizeof(struct uc_pmic_priv),
|
||||||
};
|
};
|
||||||
|
@@ -297,6 +297,15 @@ int pmic_reg_write(struct udevice *dev, uint reg, uint value);
|
|||||||
*/
|
*/
|
||||||
int pmic_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set);
|
int pmic_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This structure holds the private data for PMIC uclass
|
||||||
|
* For now we store information about the number of bytes
|
||||||
|
* being sent at once to the device.
|
||||||
|
*/
|
||||||
|
struct uc_pmic_priv {
|
||||||
|
uint trans_len;
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* CONFIG_DM_PMIC */
|
#endif /* CONFIG_DM_PMIC */
|
||||||
|
|
||||||
#ifdef CONFIG_POWER
|
#ifdef CONFIG_POWER
|
||||||
|
Reference in New Issue
Block a user