net: dsa: ks8: configure 1.8V ldo from oftree

Signed-off-by: Jan Sondhauss <jan.sondhauss@wago.com>
This commit is contained in:
Jan Sondhauss
2023-08-08 13:08:06 +02:00
committed by Oleg Karfich
parent 7d8f87b363
commit 3666e611be
4 changed files with 23 additions and 0 deletions
@@ -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
+14
View File
@@ -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
+3
View File
@@ -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);
+1
View File
@@ -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;