Lines Matching full:atmel
4 * Copyright (C) 2014 Atmel
11 #include <linux/mfd/atmel-hlcdc.h>
45 struct atmel_hlcdc_pwm *atmel = to_atmel_hlcdc_pwm(chip); in atmel_hlcdc_pwm_apply() local
46 struct atmel_hlcdc *hlcdc = atmel->hlcdc; in atmel_hlcdc_pwm_apply()
58 if (!atmel->errata || !atmel->errata->slow_clk_erratum) { in atmel_hlcdc_pwm_apply()
68 if ((atmel->errata && atmel->errata->slow_clk_erratum) || in atmel_hlcdc_pwm_apply()
81 if (!pres && atmel->errata && in atmel_hlcdc_pwm_apply()
82 atmel->errata->div1_clk_erratum) in atmel_hlcdc_pwm_apply()
94 if (new_clk != atmel->cur_clk) { in atmel_hlcdc_pwm_apply()
102 clk_disable_unprepare(atmel->cur_clk); in atmel_hlcdc_pwm_apply()
103 atmel->cur_clk = new_clk; in atmel_hlcdc_pwm_apply()
164 clk_disable_unprepare(atmel->cur_clk); in atmel_hlcdc_pwm_apply()
165 atmel->cur_clk = NULL; in atmel_hlcdc_pwm_apply()
187 struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev); in atmel_hlcdc_pwm_suspend() local
190 if (!pwm_is_enabled(&atmel->chip.pwms[0])) in atmel_hlcdc_pwm_suspend()
191 clk_disable_unprepare(atmel->hlcdc->periph_clk); in atmel_hlcdc_pwm_suspend()
198 struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev); in atmel_hlcdc_pwm_resume() local
202 pwm_get_state(&atmel->chip.pwms[0], &state); in atmel_hlcdc_pwm_resume()
206 ret = clk_prepare_enable(atmel->hlcdc->periph_clk); in atmel_hlcdc_pwm_resume()
211 return atmel_hlcdc_pwm_apply(&atmel->chip, &atmel->chip.pwms[0], in atmel_hlcdc_pwm_resume()
221 .compatible = "atmel,at91sam9n12-hlcdc",
226 .compatible = "atmel,at91sam9x5-hlcdc",
230 .compatible = "atmel,sama5d2-hlcdc",
233 .compatible = "atmel,sama5d3-hlcdc",
237 .compatible = "atmel,sama5d4-hlcdc",
249 struct atmel_hlcdc_pwm *atmel; in atmel_hlcdc_pwm_probe() local
255 atmel = devm_kzalloc(dev, sizeof(*atmel), GFP_KERNEL); in atmel_hlcdc_pwm_probe()
256 if (!atmel) in atmel_hlcdc_pwm_probe()
265 atmel->errata = match->data; in atmel_hlcdc_pwm_probe()
267 atmel->hlcdc = hlcdc; in atmel_hlcdc_pwm_probe()
268 atmel->chip.ops = &atmel_hlcdc_pwm_ops; in atmel_hlcdc_pwm_probe()
269 atmel->chip.dev = dev; in atmel_hlcdc_pwm_probe()
270 atmel->chip.npwm = 1; in atmel_hlcdc_pwm_probe()
272 ret = pwmchip_add(&atmel->chip); in atmel_hlcdc_pwm_probe()
278 platform_set_drvdata(pdev, atmel); in atmel_hlcdc_pwm_probe()
285 struct atmel_hlcdc_pwm *atmel = platform_get_drvdata(pdev); in atmel_hlcdc_pwm_remove() local
287 pwmchip_remove(&atmel->chip); in atmel_hlcdc_pwm_remove()
289 clk_disable_unprepare(atmel->hlcdc->periph_clk); in atmel_hlcdc_pwm_remove()
293 { .compatible = "atmel,hlcdc-pwm" },
299 .name = "atmel-hlcdc-pwm",
308 MODULE_ALIAS("platform:atmel-hlcdc-pwm");
310 MODULE_DESCRIPTION("Atmel HLCDC PWM driver");