mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Alain Volmat <alain.volmat@foss.st.com>,
	Hugues Fruchet <hugues.fruchet@foss.st.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-media@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,  devicetree@vger.kernel.org
Subject: Re: [PATCH v2 03/15] media: stm32: csi: addition of the STM32 CSI driver
Date: Tue, 05 Nov 2024 11:14:47 +0100	[thread overview]
Message-ID: <8841158ed61b2b92a92ac6d2afcbd7cff12a6680.camel@pengutronix.de> (raw)
In-Reply-To: <20241105-csi_dcmipp_mp25-v2-3-b9fc8a7273c2@foss.st.com>

On Di, 2024-11-05 at 08:49 +0100, Alain Volmat wrote:
> The STM32 CSI controller is tightly coupled with the DCMIPP and act as an
> input stage to receive data coming from the sensor and transferring
> them into the DCMIPP.
> 
> Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
> 
> ---
> v2: correct data-lanes handling, using values 1 & 2
>     update yaml filename in MAINTAINERS
> ---
>  MAINTAINERS                                 |    8 +
>  drivers/media/platform/st/stm32/Kconfig     |   14 +
>  drivers/media/platform/st/stm32/Makefile    |    1 +
>  drivers/media/platform/st/stm32/stm32-csi.c | 1144 +++++++++++++++++++++++++++
>  4 files changed, 1167 insertions(+)
> 
[...]
> diff --git a/drivers/media/platform/st/stm32/stm32-csi.c b/drivers/media/platform/st/stm32/stm32-csi.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..c7f47472c6b3699e94113ce0f38b280a2e45ce15
> --- /dev/null
> +++ b/drivers/media/platform/st/stm32/stm32-csi.c
> @@ -0,0 +1,1144 @@
[...]
> +static int stm32_csi_get_resources(struct stm32_csi_dev *csidev,
> +				   struct platform_device *pdev)
> +{
> +	int irq, ret;
> +
> +	csidev->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
> +	if (IS_ERR(csidev->base))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(csidev->base),
> +				     "Failed to ioremap resource\n");
> +
> +	csidev->pclk = devm_clk_get(&pdev->dev, "pclk");
> +	if (IS_ERR(csidev->pclk))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(csidev->pclk),
> +				     "Couldn't get pclk\n");
> +
> +	csidev->txesc = devm_clk_get(&pdev->dev, "txesc");
> +	if (IS_ERR(csidev->txesc))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(csidev->txesc),
> +				     "Couldn't get txesc\n");
> +
> +	csidev->csi2phy = devm_clk_get(&pdev->dev, "csi2phy");
> +	if (IS_ERR(csidev->csi2phy))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(csidev->csi2phy),
> +				     "Couldn't get csi2phy\n");

Consider using devm_clk_bulk_get().

> +	csidev->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
> +	if (IS_ERR(csidev->rstc))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(csidev->rstc),
> +				     "Couldn't get reset control\n");

If this wasn't in a separate function, rstc wouldn't have to be stored
on csidev as it's only ever used in stm32_csi_probe().

> +
> +	csidev->supplies[0].supply = "vdd";
> +	csidev->supplies[1].supply = "vdda18";
> +	ret = devm_regulator_bulk_get(&pdev->dev, ARRAY_SIZE(csidev->supplies),
> +				      csidev->supplies);
> +	if (ret)
> +		return dev_err_probe(&pdev->dev, ret,
> +				     "Failed to request regulator vdd\n");
> +
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0)
> +		return irq;
> +
> +	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
> +					stm32_csi_irq_thread, IRQF_ONESHOT,
> +					dev_name(&pdev->dev), csidev);
> +	if (ret)
> +		return dev_err_probe(&pdev->dev, ret,
> +				     "Unable to request irq");
> +
> +	return 0;
> +}

regards
Philipp

  reply	other threads:[~2024-11-05 10:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05  7:49 [PATCH v2 00/15] media: stm32: introduction of CSI / DCMIPP for STM32MP25 Alain Volmat
2024-11-05  7:49 ` [PATCH v2 01/15] media: stm32: dcmipp: correct dma_set_mask_and_coherent mask value Alain Volmat
2024-11-05  7:49 ` [PATCH v2 02/15] dt-bindings: media: add description of stm32 csi Alain Volmat
2024-11-05  9:04   ` Krzysztof Kozlowski
2024-11-05  7:49 ` [PATCH v2 03/15] media: stm32: csi: addition of the STM32 CSI driver Alain Volmat
2024-11-05 10:14   ` Philipp Zabel [this message]
2024-11-18 13:31     ` Alain Volmat
2024-11-05  7:49 ` [PATCH v2 04/15] media: stm32: dcmipp: use v4l2_subdev_is_streaming Alain Volmat
2024-11-05  7:49 ` [PATCH v2 05/15] media: stm32: dcmipp: replace s_stream with enable/disable_streams Alain Volmat
2024-11-05  7:49 ` [PATCH v2 06/15] media: stm32: dcmipp: rename dcmipp_parallel into dcmipp_input Alain Volmat
2024-11-05  7:49 ` [PATCH v2 07/15] media: stm32: dcmipp: add support for csi input into dcmipp-input Alain Volmat
2024-11-05  7:49 ` [PATCH v2 08/15] media: stm32: dcmipp: add bayer 10~14 bits formats Alain Volmat
2024-11-05  7:49 ` [PATCH v2 09/15] media: stm32: dcmipp: add 1X16 RGB / YUV formats support Alain Volmat
2024-11-05  7:49 ` [PATCH v2 10/15] media: stm32: dcmipp: avoid duplicated format on enum in bytecap Alain Volmat
2024-11-05  7:49 ` [PATCH v2 11/15] media: stm32: dcmipp: fill media ctl hw_revision field Alain Volmat
2024-11-05  7:49 ` [PATCH v2 12/15] dt-bindings: media: add the stm32mp25 compatible of DCMIPP Alain Volmat
2024-11-05  9:06   ` Krzysztof Kozlowski
2024-11-05  7:49 ` [PATCH v2 13/15] media: stm32: dcmipp: add core support for the stm32mp25 Alain Volmat
2024-11-05  7:49 ` [PATCH v2 14/15] arm64: dts: st: add csi & dcmipp node in stm32mp25 Alain Volmat
2024-11-05  7:49 ` [PATCH v2 15/15] arm64: dts: st: enable imx335/csi/dcmipp pipeline on stm32mp257f-ev1 Alain Volmat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8841158ed61b2b92a92ac6d2afcbd7cff12a6680.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=alain.volmat@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hugues.fruchet@foss.st.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mchehab@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®