aiu.c (0247142233239dc235f8239aab5c7991250d4e66) aiu.c (edc761805302db6d63916694d0cdb7468864a47a)
1// SPDX-License-Identifier: GPL-2.0
2//
3// Copyright (c) 2020 BayLibre, SAS.
4// Author: Jerome Brunet <jbrunet@baylibre.com>
5
6#include <linux/bitfield.h>
7#include <linux/clk.h>
8#include <linux/module.h>

--- 259 unchanged lines hidden (view full) ---

268 void __iomem *regs;
269 struct regmap *map;
270 struct aiu *aiu;
271 int ret;
272
273 aiu = devm_kzalloc(dev, sizeof(*aiu), GFP_KERNEL);
274 if (!aiu)
275 return -ENOMEM;
1// SPDX-License-Identifier: GPL-2.0
2//
3// Copyright (c) 2020 BayLibre, SAS.
4// Author: Jerome Brunet <jbrunet@baylibre.com>
5
6#include <linux/bitfield.h>
7#include <linux/clk.h>
8#include <linux/module.h>

--- 259 unchanged lines hidden (view full) ---

268 void __iomem *regs;
269 struct regmap *map;
270 struct aiu *aiu;
271 int ret;
272
273 aiu = devm_kzalloc(dev, sizeof(*aiu), GFP_KERNEL);
274 if (!aiu)
275 return -ENOMEM;
276
277 aiu->platform = device_get_match_data(dev);
278 if (!aiu->platform)
279 return -ENODEV;
280
276 platform_set_drvdata(pdev, aiu);
277
278 ret = device_reset(dev);
279 if (ret) {
280 if (ret != -EPROBE_DEFER)
281 dev_err(dev, "Failed to reset device\n");
282 return ret;
283 }

--- 33 unchanged lines hidden (view full) ---

317 /* Register the hdmi codec control component */
318 ret = aiu_hdmi_ctrl_register_component(dev);
319 if (ret) {
320 dev_err(dev, "Failed to register hdmi control component\n");
321 goto err;
322 }
323
324 /* Register the internal dac control component on gxl */
281 platform_set_drvdata(pdev, aiu);
282
283 ret = device_reset(dev);
284 if (ret) {
285 if (ret != -EPROBE_DEFER)
286 dev_err(dev, "Failed to reset device\n");
287 return ret;
288 }

--- 33 unchanged lines hidden (view full) ---

322 /* Register the hdmi codec control component */
323 ret = aiu_hdmi_ctrl_register_component(dev);
324 if (ret) {
325 dev_err(dev, "Failed to register hdmi control component\n");
326 goto err;
327 }
328
329 /* Register the internal dac control component on gxl */
325 if (of_device_is_compatible(dev->of_node, "amlogic,aiu-gxl")) {
330 if (aiu->platform->has_acodec) {
326 ret = aiu_acodec_ctrl_register_component(dev);
327 if (ret) {
328 dev_err(dev,
329 "Failed to register acodec control component\n");
330 goto err;
331 }
332 }
333

--- 5 unchanged lines hidden (view full) ---

339
340static int aiu_remove(struct platform_device *pdev)
341{
342 snd_soc_unregister_component(&pdev->dev);
343
344 return 0;
345}
346
331 ret = aiu_acodec_ctrl_register_component(dev);
332 if (ret) {
333 dev_err(dev,
334 "Failed to register acodec control component\n");
335 goto err;
336 }
337 }
338

--- 5 unchanged lines hidden (view full) ---

344
345static int aiu_remove(struct platform_device *pdev)
346{
347 snd_soc_unregister_component(&pdev->dev);
348
349 return 0;
350}
351
352static const struct aiu_platform_data aiu_gxbb_pdata = {
353 .has_acodec = false,
354};
355
356static const struct aiu_platform_data aiu_gxl_pdata = {
357 .has_acodec = true,
358};
359
347static const struct of_device_id aiu_of_match[] = {
360static const struct of_device_id aiu_of_match[] = {
348 { .compatible = "amlogic,aiu-gxbb", },
349 { .compatible = "amlogic,aiu-gxl", },
361 { .compatible = "amlogic,aiu-gxbb", .data = &aiu_gxbb_pdata },
362 { .compatible = "amlogic,aiu-gxl", .data = &aiu_gxl_pdata },
350 {}
351};
352MODULE_DEVICE_TABLE(of, aiu_of_match);
353
354static struct platform_driver aiu_pdrv = {
355 .probe = aiu_probe,
356 .remove = aiu_remove,
357 .driver = {
358 .name = "meson-aiu",
359 .of_match_table = aiu_of_match,
360 },
361};
362module_platform_driver(aiu_pdrv);
363
364MODULE_DESCRIPTION("Meson AIU Driver");
365MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
366MODULE_LICENSE("GPL v2");
363 {}
364};
365MODULE_DEVICE_TABLE(of, aiu_of_match);
366
367static struct platform_driver aiu_pdrv = {
368 .probe = aiu_probe,
369 .remove = aiu_remove,
370 .driver = {
371 .name = "meson-aiu",
372 .of_match_table = aiu_of_match,
373 },
374};
375module_platform_driver(aiu_pdrv);
376
377MODULE_DESCRIPTION("Meson AIU Driver");
378MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
379MODULE_LICENSE("GPL v2");