All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Freimanis <quentin@q-lab.dev>
To: Alexander Shiyan <eagle.alexander923@gmail.com>,
	linux-media@vger.kernel.org
Cc: Isaac Scott <isaac.scott@ideasonboard.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Dongcheng Yan <dongcheng.yan@intel.com>,
	devicetree@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Hans Verkuil <hverkuil@kernel.org>,
	Hans de Goede <johannes.goede@oss.qualcomm.com>,
	Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
	Mehdi Djait <mehdi.djait@linux.intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Benjamin Mugnier <benjamin.mugnier@foss.st.com>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Jingjing Xiong <jingjing.xiong@intel.com>,
	Svyatoslav Ryhel <clamor95@gmail.com>
Subject: Re: [RFC PATCH v3 2/2] media: i2c: Add onsemi AR0234 image sensor driver
Date: Mon, 4 May 2026 21:21:27 -0700	[thread overview]
Message-ID: <9bda558f-8ddd-49e1-ac5f-1f64a37fefb7@q-lab.dev> (raw)
In-Reply-To: <20260306103614.3208182-3-eagle.alexander923@gmail.com>

Hi Alexander,

On 2026-03-06 2:36 a.m., Alexander Shiyan wrote:
> +static int ar0234_identify_module(struct ar0234 *ar0234)
> +{
> +	u64 id, rev;
> +	int ret;
> +
> +	ret = cci_read(ar0234->regmap, AR0234_REG_CHIP_VERSION, &id, NULL);
> +	ret = cci_read(ar0234->regmap, AR0234_REG_REVISION_NUMBER, &rev, &ret);
> +	if (ret)
> +		return dev_err_probe(ar0234->dev, ret,
> +				     "Failed to read chip id\n");
> +
> +	if (id == AR0234_CHIP_ID_MONO)
> +		ar0234->variant = AR0234_VARIANT_MONO;
> +	else if (id == AR0234_CHIP_ID)
> +		ar0234->variant = AR0234_VARIANT_COLOUR;
> +	else
> +		return dev_err_probe(ar0234->dev, -ENODEV,
> +				     "Invalid chip id: 0x%04x\n", (u16)id);
> +
> +	dev_info(ar0234->dev, "Success reading chip id: 0x%04x, Rev.%lld\n",
> +		 (u16)id, (rev >> 12) & 0xf);
> +
> +	return ret;
> +}
> +
> +static int ar0234_power_on(struct device *dev)
> +{
> +	struct v4l2_subdev *sd = dev_get_drvdata(dev);
> +	struct ar0234 *ar0234 = to_ar0234(sd);
> +	int ret;
> +
> +	ret = regulator_bulk_enable(ARRAY_SIZE(ar0234->supplies),
> +				    ar0234->supplies);
> +	if (ret) {
> +		dev_err(ar0234->dev, "Failed to enable regulators\n");
> +		return ret;
> +	}
> +
> +	ret = clk_prepare_enable(ar0234->clk);
> +	if (ret) {
> +		dev_err(ar0234->dev, "Failed to enable clock\n");
> +		regulator_bulk_disable(ARRAY_SIZE(ar0234->supplies),
> +				       ar0234->supplies);
> +		return ret;
> +	}
> +
> +	gpiod_set_value_cansleep(ar0234->reset, 1);

should be 0 to de-assert the reset pin to power on

> +	/* ~160000 EXTCLKs */
> +	usleep_range(27000, 28000);
> +
> +	return 0;
> +}
> +
> +static int ar0234_power_off(struct device *dev)
> +{
> +	struct v4l2_subdev *sd = dev_get_drvdata(dev);
> +	struct ar0234 *ar0234 = to_ar0234(sd);
> +
> +	gpiod_set_value_cansleep(ar0234->reset, 0);

1 to assert reset to power off

> +	regulator_bulk_disable(ARRAY_SIZE(ar0234->supplies), ar0234->supplies);
> +	clk_disable_unprepare(ar0234->clk);
> +	/* 100ms PwrDown until next PwrUp */
> +	usleep_range(100000, 110000);
> +
> +	return 0;
> +}
> +
after fixing the reset polarity locally I got the driver working with a 
rgb ar0234cs in 4-lane 10bit mode using a 24mhz extclk and a 448MHz link 
frequency.

Tested-by: Quentin Freimanis <quentin@q-lab.dev>
(after the reset fix)

- Quentin

  reply	other threads:[~2026-05-05  4:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06 10:36 [RFC PATCH v3 0/2] media: i2c: Add onsemi AR0234 camera sensor driver Alexander Shiyan
2026-03-06 10:36 ` [RFC PATCH v3 1/2] dt-bindings: media: i2c: Add onsemi AR0234 image sensor binding Alexander Shiyan
2026-05-05 10:15   ` Laurent Pinchart
2026-05-05 14:09     ` Alexander Shiyan
2026-05-05 16:37       ` Laurent Pinchart
2026-03-06 10:36 ` [RFC PATCH v3 2/2] media: i2c: Add onsemi AR0234 image sensor driver Alexander Shiyan
2026-05-05  4:21   ` Quentin Freimanis [this message]
2026-05-05  7:27     ` Alexander Shiyan
2026-05-05 16:11   ` Laurent Pinchart
2026-05-06 18:41     ` Alexander Shiyan
2026-05-07 13:35     ` Alexander Shiyan
2026-05-07  4:12   ` Quentin Freimanis
2026-05-07 13:52     ` Alexander Shiyan
2026-05-05 10:29 ` [RFC PATCH v3 0/2] media: i2c: Add onsemi AR0234 camera " Laurent Pinchart

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=9bda558f-8ddd-49e1-ac5f-1f64a37fefb7@q-lab.dev \
    --to=quentin@q-lab.dev \
    --cc=benjamin.mugnier@foss.st.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dongcheng.yan@intel.com \
    --cc=eagle.alexander923@gmail.com \
    --cc=hverkuil@kernel.org \
    --cc=isaac.scott@ideasonboard.com \
    --cc=jingjing.xiong@intel.com \
    --cc=johannes.goede@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=vladimir.zapolskiy@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.