From: Andi Shyti <andi.shyti@kernel.org>
To: Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>
Cc: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] i2c: qcom-target: Add driver for Qualcomm I2C target controller
Date: Tue, 29 Sep 2026 08:51:02 +0200 [thread overview]
Message-ID: <arsBbE0UXtGKQQqS@zenone.zhora.eu> (raw)
In-Reply-To: <20260920-i2c-qcom-slave-v4-2-f7e1020f3bb4@oss.qualcomm.com>
Hi Viken,
...
> +static void qcom_i2c_target_write_requested(struct qcom_i2c_target *target)
> +{
> + u8 val = 0;
> +
> + if (!test_and_set_bit(WRITE_IN_PROGRESS, &target->status)) {
> + dev_dbg(target->dev, "Write phase started\n");
> + i2c_slave_event(target->slave, I2C_SLAVE_WRITE_REQUESTED, &val);
It's the second time in two days that I'm reviewing this:
slave_event can fail and when it fails we need to nack the next
write requests (check slave-interface.rst).
> + }
> +}
...
> +static int qcom_i2c_target_reg_slave(struct i2c_client *slave)
Please, use the inclusive name:
master -> adapter
slave -> target
> +{
> + struct qcom_i2c_target *target = i2c_get_adapdata(slave->adapter);
> +
> + if (target->slave)
> + return -EBUSY;
...
> +static int qcom_i2c_target_icc_init(struct qcom_i2c_target *target)
> +{
> + int ret;
> +
> + target->icc_path = devm_of_icc_get(target->dev, NULL);
> + if (IS_ERR(target->icc_path))
> + return dev_err_probe(target->dev, PTR_ERR(target->icc_path),
> + "failed to get ICC path\n");
> +
> + /*
> + * The controller only needs interconnect bandwidth while it is
> + * powered. The vote is placed here and across resume with
> + * icc_set_bw(), and dropped with icc_set_bw(path, 0, 0) on suspend
> + * and remove, so the vote and unvote are always symmetric.
> + */
> + ret = icc_set_bw(target->icc_path, APPS_PROC_TO_I2C_TARGET_VOTE,
> + APPS_PROC_TO_I2C_TARGET_VOTE);
TARGET_VOTE is in bytes per second, while icc_set_bw expects
kilobytes per second.
Thanks,
Andi
> + if (ret)
> + return dev_err_probe(target->dev, ret, "icc_set_bw failed\n");
> +
> + return 0;
> +}
prev parent reply other threads:[~2026-09-29 6:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 12:04 [PATCH v4 0/2] Add Qualcomm I2C target controller driver Viken Dadhaniya
2026-09-20 12:04 ` [PATCH v4 1/2] dt-bindings: i2c: Add Qualcomm I2C target controller Viken Dadhaniya
2026-09-20 12:12 ` sashiko-bot
2026-09-20 12:04 ` [PATCH v4 2/2] i2c: qcom-target: Add driver for " Viken Dadhaniya
2026-09-20 12:17 ` sashiko-bot
2026-09-29 6:51 ` Andi Shyti [this message]
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=arsBbE0UXtGKQQqS@zenone.zhora.eu \
--to=andi.shyti@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mukesh.savaliya@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=viken.dadhaniya@oss.qualcomm.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