mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
Merge branch 'ksz-switch-refclk'
Robert Hancock says: ==================== Allow disabling KSZ switch refclock The reference clock output from the KSZ9477 and related Microchip switch devices is not required on all board designs. Add a device tree property to disable it for power and EMI reasons. Changes since v3: -rework some code for simplicity Changes since v2: -check for conflicting options in DT, added note in bindings doc Changes since v1: -added Acked-by on patch 1, rebase to net-next ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
1a918a32cd
4 changed files with 19 additions and 3 deletions
|
@ -42,6 +42,12 @@ properties:
|
||||||
description:
|
description:
|
||||||
Set if the output SYNCLKO frequency should be set to 125MHz instead of 25MHz.
|
Set if the output SYNCLKO frequency should be set to 125MHz instead of 25MHz.
|
||||||
|
|
||||||
|
microchip,synclko-disable:
|
||||||
|
$ref: /schemas/types.yaml#/definitions/flag
|
||||||
|
description:
|
||||||
|
Set if the output SYNCLKO clock should be disabled. Do not mix with
|
||||||
|
microchip,synclko-125.
|
||||||
|
|
||||||
required:
|
required:
|
||||||
- compatible
|
- compatible
|
||||||
- reg
|
- reg
|
||||||
|
|
|
@ -222,9 +222,12 @@ static int ksz9477_reset_switch(struct ksz_device *dev)
|
||||||
(BROADCAST_STORM_VALUE *
|
(BROADCAST_STORM_VALUE *
|
||||||
BROADCAST_STORM_PROT_RATE) / 100);
|
BROADCAST_STORM_PROT_RATE) / 100);
|
||||||
|
|
||||||
if (dev->synclko_125)
|
data8 = SW_ENABLE_REFCLKO;
|
||||||
ksz_write8(dev, REG_SW_GLOBAL_OUTPUT_CTRL__1,
|
if (dev->synclko_disable)
|
||||||
SW_ENABLE_REFCLKO | SW_REFCLKO_IS_125MHZ);
|
data8 = 0;
|
||||||
|
else if (dev->synclko_125)
|
||||||
|
data8 = SW_ENABLE_REFCLKO | SW_REFCLKO_IS_125MHZ;
|
||||||
|
ksz_write8(dev, REG_SW_GLOBAL_OUTPUT_CTRL__1, data8);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -434,6 +434,12 @@ int ksz_switch_register(struct ksz_device *dev,
|
||||||
}
|
}
|
||||||
dev->synclko_125 = of_property_read_bool(dev->dev->of_node,
|
dev->synclko_125 = of_property_read_bool(dev->dev->of_node,
|
||||||
"microchip,synclko-125");
|
"microchip,synclko-125");
|
||||||
|
dev->synclko_disable = of_property_read_bool(dev->dev->of_node,
|
||||||
|
"microchip,synclko-disable");
|
||||||
|
if (dev->synclko_125 && dev->synclko_disable) {
|
||||||
|
dev_err(dev->dev, "inconsistent synclko settings\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = dsa_register_switch(dev->ds);
|
ret = dsa_register_switch(dev->ds);
|
||||||
|
|
|
@ -75,6 +75,7 @@ struct ksz_device {
|
||||||
u32 regs_size;
|
u32 regs_size;
|
||||||
bool phy_errata_9477;
|
bool phy_errata_9477;
|
||||||
bool synclko_125;
|
bool synclko_125;
|
||||||
|
bool synclko_disable;
|
||||||
|
|
||||||
struct vlan_table *vlan_cache;
|
struct vlan_table *vlan_cache;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue