Lines Matching +full:ingenic +full:- +full:tcu

1 // SPDX-License-Identifier: GPL-2.0
3 * JZ47xx SoCs TCU Operating System Timer driver
11 #include <linux/mfd/ingenic-tcu.h>
25 * The TCU_REG_OST_CNT{L,R} from <linux/mfd/ingenic-tcu.h> are only for the
47 return readl(ingenic_ost->regs + OST_REG_CNTL); in ingenic_ost_read_cntl()
53 return readl(ingenic_ost->regs + OST_REG_CNTH); in ingenic_ost_read_cnth()
69 struct device *dev = &pdev->dev; in ingenic_ost_probe()
78 return -EINVAL; in ingenic_ost_probe()
82 return -ENOMEM; in ingenic_ost_probe()
86 ost->regs = devm_platform_ioremap_resource(pdev, 0); in ingenic_ost_probe()
87 if (IS_ERR(ost->regs)) in ingenic_ost_probe()
88 return PTR_ERR(ost->regs); in ingenic_ost_probe()
90 map = device_node_to_regmap(dev->parent->of_node); in ingenic_ost_probe()
93 return -EINVAL; in ingenic_ost_probe()
96 ost->clk = devm_clk_get(dev, "ost"); in ingenic_ost_probe()
97 if (IS_ERR(ost->clk)) in ingenic_ost_probe()
98 return PTR_ERR(ost->clk); in ingenic_ost_probe()
100 err = clk_prepare_enable(ost->clk); in ingenic_ost_probe()
105 if (soc_info->is64bit) in ingenic_ost_probe()
113 rate = clk_get_rate(ost->clk); in ingenic_ost_probe()
115 /* Enable OST TCU channel */ in ingenic_ost_probe()
118 cs = &ost->cs; in ingenic_ost_probe()
119 cs->name = "ingenic-ost"; in ingenic_ost_probe()
120 cs->rating = 320; in ingenic_ost_probe()
121 cs->flags = CLOCK_SOURCE_IS_CONTINUOUS; in ingenic_ost_probe()
122 cs->mask = CLOCKSOURCE_MASK(32); in ingenic_ost_probe()
124 if (soc_info->is64bit) in ingenic_ost_probe()
125 cs->read = ingenic_ost_clocksource_readl; in ingenic_ost_probe()
127 cs->read = ingenic_ost_clocksource_readh; in ingenic_ost_probe()
132 clk_disable_unprepare(ost->clk); in ingenic_ost_probe()
136 if (soc_info->is64bit) in ingenic_ost_probe()
148 clk_disable(ost->clk); in ingenic_ost_suspend()
157 return clk_enable(ost->clk); in ingenic_ost_resume()
175 { .compatible = "ingenic,jz4725b-ost", .data = &jz4725b_ost_soc_info, },
176 { .compatible = "ingenic,jz4770-ost", .data = &jz4770_ost_soc_info, },
182 .name = "ingenic-ost",