Lines Matching refs:ddata
41 struct atmel_flexcom *ddata; in atmel_flexcom_probe() local
44 ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); in atmel_flexcom_probe()
45 if (!ddata) in atmel_flexcom_probe()
48 platform_set_drvdata(pdev, ddata); in atmel_flexcom_probe()
50 err = of_property_read_u32(np, "atmel,flexcom-mode", &ddata->opmode); in atmel_flexcom_probe()
54 if (ddata->opmode < ATMEL_FLEXCOM_MODE_USART || in atmel_flexcom_probe()
55 ddata->opmode > ATMEL_FLEXCOM_MODE_TWI) in atmel_flexcom_probe()
59 ddata->base = devm_ioremap_resource(&pdev->dev, res); in atmel_flexcom_probe()
60 if (IS_ERR(ddata->base)) in atmel_flexcom_probe()
61 return PTR_ERR(ddata->base); in atmel_flexcom_probe()
63 ddata->clk = devm_clk_get(&pdev->dev, NULL); in atmel_flexcom_probe()
64 if (IS_ERR(ddata->clk)) in atmel_flexcom_probe()
65 return PTR_ERR(ddata->clk); in atmel_flexcom_probe()
67 err = clk_prepare_enable(ddata->clk); in atmel_flexcom_probe()
77 writel(FLEX_MR_OPMODE(ddata->opmode), ddata->base + FLEX_MR); in atmel_flexcom_probe()
79 clk_disable_unprepare(ddata->clk); in atmel_flexcom_probe()
92 struct atmel_flexcom *ddata = dev_get_drvdata(dev); in atmel_flexcom_resume_noirq() local
96 err = clk_prepare_enable(ddata->clk); in atmel_flexcom_resume_noirq()
100 val = FLEX_MR_OPMODE(ddata->opmode), in atmel_flexcom_resume_noirq()
101 writel(val, ddata->base + FLEX_MR); in atmel_flexcom_resume_noirq()
103 clk_disable_unprepare(ddata->clk); in atmel_flexcom_resume_noirq()