Lines Matching refs:mxs
50 struct mxs_pwm_chip *mxs = to_mxs_pwm_chip(chip); in mxs_pwm_apply() local
63 ret = clk_prepare_enable(mxs->clk); in mxs_pwm_apply()
69 writel(1 << pwm->hwpwm, mxs->base + PWM_CTRL + CLR); in mxs_pwm_apply()
71 rate = clk_get_rate(mxs->clk); in mxs_pwm_apply()
98 mxs->base + PWM_ACTIVE0 + pwm->hwpwm * 0x20); in mxs_pwm_apply()
100 mxs->base + PWM_PERIOD0 + pwm->hwpwm * 0x20); in mxs_pwm_apply()
108 writel(1 << pwm->hwpwm, mxs->base + PWM_CTRL + SET); in mxs_pwm_apply()
111 clk_disable_unprepare(mxs->clk); in mxs_pwm_apply()
124 struct mxs_pwm_chip *mxs; in mxs_pwm_probe() local
127 mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL); in mxs_pwm_probe()
128 if (!mxs) in mxs_pwm_probe()
131 mxs->base = devm_platform_ioremap_resource(pdev, 0); in mxs_pwm_probe()
132 if (IS_ERR(mxs->base)) in mxs_pwm_probe()
133 return PTR_ERR(mxs->base); in mxs_pwm_probe()
135 mxs->clk = devm_clk_get(&pdev->dev, NULL); in mxs_pwm_probe()
136 if (IS_ERR(mxs->clk)) in mxs_pwm_probe()
137 return PTR_ERR(mxs->clk); in mxs_pwm_probe()
139 mxs->chip.dev = &pdev->dev; in mxs_pwm_probe()
140 mxs->chip.ops = &mxs_pwm_ops; in mxs_pwm_probe()
142 ret = of_property_read_u32(np, "fsl,pwm-number", &mxs->chip.npwm); in mxs_pwm_probe()
149 ret = stmp_reset_block(mxs->base); in mxs_pwm_probe()
153 ret = devm_pwmchip_add(&pdev->dev, &mxs->chip); in mxs_pwm_probe()