diff options
author | Michael Tretter <m.tretter@pengutronix.de> | 2021-09-08 14:03:12 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-10-20 15:53:12 +0100 |
commit | b6707e770d832da586a4b42d4d45b3a91d5f98c2 (patch) | |
tree | fe15d69dd19d83d176bbe805ccb268576d258eb3 /drivers/media | |
parent | dacc21d638c427a53448d91bd976ee6762822911 (diff) |
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>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/allegro-dvt/allegro-core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c index 89d6de6082f6..2663d9da0522 100644 --- a/drivers/media/platform/allegro-dvt/allegro-core.c +++ b/drivers/media/platform/allegro-dvt/allegro-core.c @@ -12,6 +12,8 @@ #include <linux/io.h> #include <linux/kernel.h> #include <linux/log2.h> +#include <linux/mfd/syscon.h> +#include <linux/mfd/syscon/xlnx-vcu.h> #include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> @@ -136,6 +138,7 @@ struct allegro_dev { struct regmap *regmap; struct regmap *sram; + struct regmap *settings; const struct fw_info *fw_info; struct allegro_buffer firmware; @@ -3721,6 +3724,10 @@ static int allegro_probe(struct platform_device *pdev) return PTR_ERR(dev->sram); } + dev->settings = syscon_regmap_lookup_by_compatible("xlnx,vcu-settings"); + if (IS_ERR(dev->settings)) + dev_warn(&pdev->dev, "failed to open settings\n"); + irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; |