net: dsa: ks8: configure 1.8V ldo from oftree
Signed-off-by: Jan Sondhauss <jan.sondhauss@wago.com>
This commit is contained in:
committed by
Oleg Karfich
parent
7d8f87b363
commit
3666e611be
@@ -49,6 +49,11 @@ properties:
|
||||
Set if the output SYNCLKO clock should be disabled. Do not mix with
|
||||
microchip,synclko-125.
|
||||
|
||||
microchip,disable-internal-ldo:
|
||||
$ref: /schemas/types.yaml#/definitions/flag
|
||||
description:
|
||||
Set if the internal 1.8V LDO should be disabled.
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
|
||||
@@ -1390,11 +1390,25 @@ int ksz8_enable_stp_addr(struct ksz_device *dev)
|
||||
return ksz8_w_sta_mac_table(dev, 0, &alu);
|
||||
}
|
||||
|
||||
static void ksz8_set_internal_ldo(struct ksz_device *dev)
|
||||
{
|
||||
#define REG_INTERNAL_1V8_LDO_CTRL 0xC1
|
||||
#define REG_INTERNAL_1V8_LDO_CTRL_DISABLE BIT(6)
|
||||
|
||||
ksz_cfg(dev, REG_INTERNAL_1V8_LDO_CTRL, REG_INTERNAL_1V8_LDO_CTRL_DISABLE,
|
||||
dev->disable_internal_ldo);
|
||||
|
||||
if (dev->disable_internal_ldo)
|
||||
dev_info(dev->dev, "1.8V LDO disabled\n");
|
||||
}
|
||||
|
||||
int ksz8_setup(struct dsa_switch *ds)
|
||||
{
|
||||
struct ksz_device *dev = ds->priv;
|
||||
int i;
|
||||
|
||||
ksz8_set_internal_ldo(dev);
|
||||
|
||||
ds->mtu_enforcement_ingress = true;
|
||||
|
||||
/* We rely on software untagging on the CPU port, so that we
|
||||
|
||||
@@ -3651,6 +3651,9 @@ int ksz_switch_register(struct ksz_device *dev)
|
||||
dev_err(dev->dev, "inconsistent synclko settings\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dev->disable_internal_ldo = of_property_read_bool(dev->dev->of_node,
|
||||
"microchip,disable-internal-ldo");
|
||||
}
|
||||
|
||||
ret = dsa_register_switch(dev->ds);
|
||||
|
||||
@@ -148,6 +148,7 @@ struct ksz_device {
|
||||
int irq;
|
||||
|
||||
struct gpio_desc *reset_gpio; /* Optional reset GPIO */
|
||||
bool disable_internal_ldo; /* Disable internal 1.8V LDO */
|
||||
|
||||
/* chip specific data */
|
||||
u32 chip_id;
|
||||
|
||||
Reference in New Issue
Block a user