Lines Matching refs:imx
39 struct pwm_imx1_chip *imx = to_pwm_imx1_chip(chip); in pwm_imx1_clk_prepare_enable() local
42 ret = clk_prepare_enable(imx->clk_ipg); in pwm_imx1_clk_prepare_enable()
46 ret = clk_prepare_enable(imx->clk_per); in pwm_imx1_clk_prepare_enable()
48 clk_disable_unprepare(imx->clk_ipg); in pwm_imx1_clk_prepare_enable()
57 struct pwm_imx1_chip *imx = to_pwm_imx1_chip(chip); in pwm_imx1_clk_disable_unprepare() local
59 clk_disable_unprepare(imx->clk_per); in pwm_imx1_clk_disable_unprepare()
60 clk_disable_unprepare(imx->clk_ipg); in pwm_imx1_clk_disable_unprepare()
66 struct pwm_imx1_chip *imx = to_pwm_imx1_chip(chip); in pwm_imx1_config() local
86 max = readl(imx->mmio_base + MX1_PWMP); in pwm_imx1_config()
89 writel(max - p, imx->mmio_base + MX1_PWMS); in pwm_imx1_config()
96 struct pwm_imx1_chip *imx = to_pwm_imx1_chip(chip); in pwm_imx1_enable() local
104 value = readl(imx->mmio_base + MX1_PWMC); in pwm_imx1_enable()
106 writel(value, imx->mmio_base + MX1_PWMC); in pwm_imx1_enable()
113 struct pwm_imx1_chip *imx = to_pwm_imx1_chip(chip); in pwm_imx1_disable() local
116 value = readl(imx->mmio_base + MX1_PWMC); in pwm_imx1_disable()
118 writel(value, imx->mmio_base + MX1_PWMC); in pwm_imx1_disable()
161 struct pwm_imx1_chip *imx; in pwm_imx1_probe() local
163 imx = devm_kzalloc(&pdev->dev, sizeof(*imx), GFP_KERNEL); in pwm_imx1_probe()
164 if (!imx) in pwm_imx1_probe()
167 imx->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); in pwm_imx1_probe()
168 if (IS_ERR(imx->clk_ipg)) in pwm_imx1_probe()
169 return dev_err_probe(&pdev->dev, PTR_ERR(imx->clk_ipg), in pwm_imx1_probe()
172 imx->clk_per = devm_clk_get(&pdev->dev, "per"); in pwm_imx1_probe()
173 if (IS_ERR(imx->clk_per)) in pwm_imx1_probe()
174 return dev_err_probe(&pdev->dev, PTR_ERR(imx->clk_per), in pwm_imx1_probe()
177 imx->chip.ops = &pwm_imx1_ops; in pwm_imx1_probe()
178 imx->chip.dev = &pdev->dev; in pwm_imx1_probe()
179 imx->chip.npwm = 1; in pwm_imx1_probe()
181 imx->mmio_base = devm_platform_ioremap_resource(pdev, 0); in pwm_imx1_probe()
182 if (IS_ERR(imx->mmio_base)) in pwm_imx1_probe()
183 return PTR_ERR(imx->mmio_base); in pwm_imx1_probe()
185 return devm_pwmchip_add(&pdev->dev, &imx->chip); in pwm_imx1_probe()