Microchip clock fixes for v7.1

This update includes:
 - fix the GMAC GCLK clock ID for the SAM9X7 SoC
 - properly decrement the reference count of a struct device_node
   in pmc_register_ops() after it is no longer needed
 - fix the MPFS peripheral driver registration failures by using the proper
   size and mapping for the output clocks array
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTsZ8eserC1pmhwqDmejrg/N2X7/QUCahxGVQAKCRCejrg/N2X7
 /VrBAQCz+LjzlH0arHQ/9nHO7sNtZTdRL9OffSoXUpa3cDsp/wD+LJT7/bBedXCa
 InUzF9g/iJSh5rixwbIhVBNm9ieB2A4=
 =0Izd
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCAAyFiEE9L57QeeUxqYDyoaDrQKIl8bklSUFAmotx4gUHHN3Ym95ZEBj
 aHJvbWl1bS5vcmcACgkQrQKIl8bklSU7QQ//eNChi4HIGCWChEnD3DR0kevLLx+9
 qafiZmsZg5D15IpLbnsji28gsJS4QcvqMKLX18DugHrVTV/DN3g1r1lsAa6Q+foK
 3qlTyuZueFugVxgFx64b3QIxtjM9q9iQBXyTBXWdMJq/DTrLDnpRHRMJ6kyQ/bcr
 +n5D6M0l/boOs7v9bONSy6+QgOEzeBy7enz3p0PkBJ7Ol44nLERlqYiIxP6/q46o
 inlS3V7DniQueJzUHL09EQ+HPDjCceiQt+BO7NP63c/WwBl8XAKS8gGvP/87dww4
 PEc5tJDkK1LPgfWqyl/8PImpBZ2Gvywlj8nVIsGNGxWqQyDVPyWjbW/twAIN4o5T
 nApnsSUEUVI4WMlE8MwfpfZx2XEdZlS6OrflqjNcrPBkdFX5t2B/d8IO/+tJP8Xq
 xjbD3KP3dP5K8buKaC2BqEHOCbyZkQjhrYndrK3sTEI6KAphxcTVPlAHDDtNmRAp
 fomdzn9fY4ftrOmwpmDNoC3yZocpbIjpD/gBCmxz54DJc2GpIwYwTTY1xxj8qofN
 TUndY2+OcUoPLZ3s5+jCgxAmPLA0+4b2BP1bg54lJer8fca/gTLvNbS83oVDWnPO
 XFLG7RjD7B1lSToDdEVCl2nwgkWVk2TsI1w3mTcRPE96hfGnwFp0q9EUXNKd3mzz
 qw0Us6wEQhHeWWw=
 =yTjq
 -----END PGP SIGNATURE-----

Merge tag 'clk-microchip-fixes-7.1' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-microchip

Pull Microchip clock fixes from Claudiu Beznea:

 - Fix the GMAC GCLK clock ID for the SAM9X7 SoC
 - Properly decrement the reference count of a struct device_node
   in pmc_register_ops() after it is no longer needed
 - Fix the MPFS peripheral driver registration failures by using the proper
   size and mapping for the output clocks array

[sboyd@kernel.org: These all look non-critical so not taking for
clk-fixes]

* tag 'clk-microchip-fixes-7.1' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  clk: at91: keep securam node alive while mapping it
  clk: microchip: mpfs-ccc: fix peripheral driver registration failures after oob fix
  clk: at91: sam9x7: Fix gmac_gclk clock definition
This commit is contained in:
Stephen Boyd 2026-06-13 14:10:42 -07:00
commit 19ec63c4ef
3 changed files with 14 additions and 21 deletions

View File

@ -180,9 +180,9 @@ static int __init pmc_register_ops(void)
of_node_put(np);
return -ENODEV;
}
of_node_put(np);
at91_pmc_backup_suspend = of_iomap(np, 0);
of_node_put(np);
if (!at91_pmc_backup_suspend) {
pr_warn("%s(): unable to map securam\n", __func__);
return -ENOMEM;

View File

@ -568,6 +568,15 @@ static const struct {
.pp_chg_id = INT_MIN,
},
{
.n = "gmac_gclk",
.id = 24,
.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
.pp_mux_table = { 6, 8, },
.pp_count = 2,
.pp_chg_id = INT_MIN,
},
{
.n = "lcd_gclk",
.id = 25,
@ -701,15 +710,6 @@ static const struct {
.pp_count = 1,
.pp_chg_id = INT_MIN,
},
{
.n = "gmac_gclk",
.id = 67,
.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
.pp_mux_table = { 6, 8, },
.pp_count = 2,
.pp_chg_id = INT_MIN,
},
};
static void __init sam9x7_pmc_setup(struct device_node *np)

View File

@ -32,6 +32,7 @@
#define MPFS_CCC_FIXED_DIV 4
#define MPFS_CCC_OUTPUTS_PER_PLL 4
#define MPFS_CCC_REFS_PER_PLL 2
#define MPFS_CCC_NUM_CLKS 16
struct mpfs_ccc_data {
void __iomem **pll_base;
@ -178,7 +179,7 @@ static int mpfs_ccc_register_outputs(struct device *dev, struct mpfs_ccc_out_hw_
return dev_err_probe(dev, ret, "failed to register clock id: %d\n",
out_hw->id);
data->hw_data.hws[out_hw->id - 2] = &out_hw->divider.hw;
data->hw_data.hws[out_hw->id] = &out_hw->divider.hw;
}
return 0;
@ -231,17 +232,9 @@ static int mpfs_ccc_probe(struct platform_device *pdev)
{
struct mpfs_ccc_data *clk_data;
void __iomem *pll_base[ARRAY_SIZE(mpfs_ccc_pll_clks)];
unsigned int num_clks;
int ret;
/*
* If DLLs get added here, mpfs_ccc_register_outputs() currently packs
* sparse clock IDs in the hws array
*/
num_clks = ARRAY_SIZE(mpfs_ccc_pll_clks) + ARRAY_SIZE(mpfs_ccc_pll0out_clks) +
ARRAY_SIZE(mpfs_ccc_pll1out_clks);
clk_data = devm_kzalloc(&pdev->dev, struct_size(clk_data, hw_data.hws, num_clks),
clk_data = devm_kzalloc(&pdev->dev, struct_size(clk_data, hw_data.hws, MPFS_CCC_NUM_CLKS),
GFP_KERNEL);
if (!clk_data)
return -ENOMEM;
@ -255,7 +248,7 @@ static int mpfs_ccc_probe(struct platform_device *pdev)
return PTR_ERR(pll_base[1]);
clk_data->pll_base = pll_base;
clk_data->hw_data.num = num_clks;
clk_data->hw_data.num = MPFS_CCC_NUM_CLKS;
clk_data->dev = &pdev->dev;
ret = mpfs_ccc_register_plls(clk_data->dev, mpfs_ccc_pll_clks,