Lines Matching refs:ecc
27 int ingenic_ecc_calculate(struct ingenic_ecc *ecc, in ingenic_ecc_calculate() argument
31 return ecc->ops->calculate(ecc, params, buf, ecc_code); in ingenic_ecc_calculate()
47 int ingenic_ecc_correct(struct ingenic_ecc *ecc, in ingenic_ecc_correct() argument
51 return ecc->ops->correct(ecc, params, buf, ecc_code); in ingenic_ecc_correct()
68 struct ingenic_ecc *ecc; in ingenic_ecc_get() local
79 ecc = platform_get_drvdata(pdev); in ingenic_ecc_get()
80 clk_prepare_enable(ecc->clk); in ingenic_ecc_get()
82 return ecc; in ingenic_ecc_get()
97 struct ingenic_ecc *ecc = NULL; in of_ingenic_ecc_get() local
110 ecc = ingenic_ecc_get(np); in of_ingenic_ecc_get()
113 return ecc; in of_ingenic_ecc_get()
120 void ingenic_ecc_release(struct ingenic_ecc *ecc) in ingenic_ecc_release() argument
122 clk_disable_unprepare(ecc->clk); in ingenic_ecc_release()
123 put_device(ecc->dev); in ingenic_ecc_release()
129 struct ingenic_ecc *ecc; in ingenic_ecc_probe() local
131 ecc = devm_kzalloc(dev, sizeof(*ecc), GFP_KERNEL); in ingenic_ecc_probe()
132 if (!ecc) in ingenic_ecc_probe()
135 ecc->ops = device_get_match_data(dev); in ingenic_ecc_probe()
136 if (!ecc->ops) in ingenic_ecc_probe()
139 ecc->base = devm_platform_ioremap_resource(pdev, 0); in ingenic_ecc_probe()
140 if (IS_ERR(ecc->base)) in ingenic_ecc_probe()
141 return PTR_ERR(ecc->base); in ingenic_ecc_probe()
143 ecc->ops->disable(ecc); in ingenic_ecc_probe()
145 ecc->clk = devm_clk_get(dev, NULL); in ingenic_ecc_probe()
146 if (IS_ERR(ecc->clk)) { in ingenic_ecc_probe()
147 dev_err(dev, "failed to get clock: %ld\n", PTR_ERR(ecc->clk)); in ingenic_ecc_probe()
148 return PTR_ERR(ecc->clk); in ingenic_ecc_probe()
151 mutex_init(&ecc->lock); in ingenic_ecc_probe()
153 ecc->dev = dev; in ingenic_ecc_probe()
154 platform_set_drvdata(pdev, ecc); in ingenic_ecc_probe()