Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: allegro: lookup VCU settings

The VCU provides information about its configuration in a dedicated
register space. These settings include, for example, the expected clock
rates and the configuration of the encoder buffer. In the device tree,
the settings are described by the "xlnx,vcu-settings" compatible.

The settings are needed to correctly configure the clocks and the
encoder buffer.

Lookup the VCU settings in the device tree and make it accessible to the
driver via a regmap.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Michael Tretter and committed by
Mauro Carvalho Chehab
b6707e77 dacc21d6

+7
+7
drivers/media/platform/allegro-dvt/allegro-core.c
··· 12 12 #include <linux/io.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/log2.h> 15 + #include <linux/mfd/syscon.h> 16 + #include <linux/mfd/syscon/xlnx-vcu.h> 15 17 #include <linux/module.h> 16 18 #include <linux/of.h> 17 19 #include <linux/of_device.h> ··· 138 136 139 137 struct regmap *regmap; 140 138 struct regmap *sram; 139 + struct regmap *settings; 141 140 142 141 const struct fw_info *fw_info; 143 142 struct allegro_buffer firmware; ··· 3723 3720 dev_err(&pdev->dev, "failed to init sram\n"); 3724 3721 return PTR_ERR(dev->sram); 3725 3722 } 3723 + 3724 + dev->settings = syscon_regmap_lookup_by_compatible("xlnx,vcu-settings"); 3725 + if (IS_ERR(dev->settings)) 3726 + dev_warn(&pdev->dev, "failed to open settings\n"); 3726 3727 3727 3728 irq = platform_get_irq(pdev, 0); 3728 3729 if (irq < 0)