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()
185 struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev); in atmel_hlcdc_pwm_suspend() local
188 if (pwm_is_enabled(&atmel->chip.pwms[0])) in atmel_hlcdc_pwm_suspend()
189 clk_disable_unprepare(atmel->hlcdc->periph_clk); in atmel_hlcdc_pwm_suspend()
196 struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev); in atmel_hlcdc_pwm_resume() local
200 pwm_get_state(&atmel->chip.pwms[0], &state); in atmel_hlcdc_pwm_resume()
204 ret = clk_prepare_enable(atmel->hlcdc->periph_clk); in atmel_hlcdc_pwm_resume()
209 return atmel_hlcdc_pwm_apply(&atmel->chip, &atmel->chip.pwms[0], in atmel_hlcdc_pwm_resume()
218 .compatible = "atmel,at91sam9n12-hlcdc",
223 .compatible = "atmel,at91sam9x5-hlcdc",
227 .compatible = "atmel,sama5d2-hlcdc",
230 .compatible = "atmel,sama5d3-hlcdc",
234 .compatible = "atmel,sama5d4-hlcdc",
246 struct atmel_hlcdc_pwm *atmel; in atmel_hlcdc_pwm_probe() local
252 atmel = devm_kzalloc(dev, sizeof(*atmel), GFP_KERNEL); in atmel_hlcdc_pwm_probe()
253 if (!atmel) in atmel_hlcdc_pwm_probe()
262 atmel->errata = match->data; in atmel_hlcdc_pwm_probe()
264 atmel->hlcdc = hlcdc; in atmel_hlcdc_pwm_probe()
265 atmel->chip.ops = &atmel_hlcdc_pwm_ops; in atmel_hlcdc_pwm_probe()
266 atmel->chip.dev = dev; in atmel_hlcdc_pwm_probe()
267 atmel->chip.npwm = 1; in atmel_hlcdc_pwm_probe()
269 ret = pwmchip_add(&atmel->chip); in atmel_hlcdc_pwm_probe()
275 platform_set_drvdata(pdev, atmel); in atmel_hlcdc_pwm_probe()
282 struct atmel_hlcdc_pwm *atmel = platform_get_drvdata(pdev); in atmel_hlcdc_pwm_remove() local
284 pwmchip_remove(&atmel->chip); in atmel_hlcdc_pwm_remove()
286 clk_disable_unprepare(atmel->hlcdc->periph_clk); in atmel_hlcdc_pwm_remove()
290 { .compatible = "atmel,hlcdc-pwm" },
296 .name = "atmel-hlcdc-pwm",
305 MODULE_ALIAS("platform:atmel-hlcdc-pwm");
307 MODULE_DESCRIPTION("Atmel HLCDC PWM driver");