From: Pengyu Luo <mitltlatltl@gmail.com>
To: heikki.krogerus@linux.intel.com
Cc: andersson@kernel.org, bryan.odonoghue@linaro.org,
conor+dt@kernel.org, devicetree@vger.kernel.org,
dmitry.baryshkov@linaro.org, gregkh@linuxfoundation.org,
hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com,
jdelvare@suse.com, konradybcio@kernel.org, krzk+dt@kernel.org,
linux-arm-msm@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
linux-usb@vger.kernel.org, linux@roeck-us.net,
mitltlatltl@gmail.com, platform-driver-x86@vger.kernel.org,
robh@kernel.org, sre@kernel.org
Subject: Re: [PATCH v2 2/5] platform: arm64: add Huawei Matebook E Go EC driver
Date: Wed, 8 Jan 2025 00:53:33 +0800 [thread overview]
Message-ID: <20250107165335.114744-1-mitltlatltl@gmail.com> (raw)
In-Reply-To: <Z30dIRA4MdtCp63q@kuha.fi.intel.com>
On Tue, Jan 7, 2025 at 8:25 PM Heikki Krogerus <heikki.krogerus@linux.intel.com> wrote:
>
> Hi,
>
> > +/* -------------------------------------------------------------------------- */
> > +/* API For UCSI */
> > +
> > +int gaokun_ec_ucsi_read(struct gaokun_ec *ec,
> > + u8 resp[GAOKUN_UCSI_READ_SIZE])
> > +{
> > + u8 req[] = MKREQ(0x03, 0xD5, 0);
> > + u8 _resp[] = MKRESP(GAOKUN_UCSI_READ_SIZE);
> > + int ret;
> > +
> > + ret = gaokun_ec_read(ec, req, sizeof(_resp), _resp);
> > + if (ret)
> > + return ret;
> > +
> > + extr_resp(resp, _resp, GAOKUN_UCSI_READ_SIZE);
> > + return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(gaokun_ec_ucsi_read);
> > +
> > +int gaokun_ec_ucsi_write(struct gaokun_ec *ec,
> > + const u8 req[GAOKUN_UCSI_WRITE_SIZE])
> > +{
> > + u8 _req[] = MKREQ(0x03, 0xD4, GAOKUN_UCSI_WRITE_SIZE);
> > +
> > +
> > + refill_req(_req, req, GAOKUN_UCSI_WRITE_SIZE);
> > +
> > + return gaokun_ec_write(ec, _req);
> > +}
> > +EXPORT_SYMBOL_GPL(gaokun_ec_ucsi_write);
> > +
> > +int gaokun_ec_ucsi_get_reg(struct gaokun_ec *ec, u8 *ureg)
> > +{
> > + u8 req[] = MKREQ(0x03, 0xD3, 0);
> > + u8 _resp[] = MKRESP(UCSI_REG_SIZE);
> > + int ret;
> > +
> > + ret = gaokun_ec_read(ec, req, sizeof(_resp), _resp);
> > + if (ret)
> > + return ret;
> > +
> > + extr_resp(ureg, _resp, UCSI_REG_SIZE);
> > +
> > + return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(gaokun_ec_ucsi_get_reg);
>
> Why not just take struct gaokun_ucsi_reg as parameter? I did not see
> this (or any of these) being used anywhere else except in your UCSI
> glue driver. So the prototype would be:
>
> int gaokun_ec_ucsi_get_reg(struct gaokun_ec *ec,
> struct gaokun_ucsi_reg *reg);
>
Understood
> > +int gaokun_ec_ucsi_pan_ack(struct gaokun_ec *ec, int port_id)
> > +{
> > + u8 req[] = MKREQ(0x03, 0xD2, 1);
> > + u8 data = 1 << port_id;
> > +
> > + if (port_id == GAOKUN_UCSI_NO_PORT_UPDATE)
> > + data = 0;
> > +
> > + refill_req(req, &data, 1);
> > +
> > + return gaokun_ec_write(ec, req);
> > +}
> > +EXPORT_SYMBOL_GPL(gaokun_ec_ucsi_pan_ack);
>
> I think you should add proper kernel doc comments to these exported
> functions.
>
Oh, I forgot some of them. gaokun_ec_ucsi_get_reg and
gaokun_ec_ucsi_pan_ack deserve kernel doc comments. Judging from the name,
others are obvious, should I comment all?
> thanks,
>
> --
> heikki
Best wishes,
Pengyu
next prev parent reply other threads:[~2025-01-07 16:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-05 17:41 [PATCH v2 0/5] platform: arm64: Huawei Matebook E Go embedded controller Pengyu Luo
2025-01-05 17:41 ` [PATCH v2 1/5] dt-bindings: platform: Add Huawei Matebook E Go EC Pengyu Luo
2025-01-06 7:11 ` Krzysztof Kozlowski
2025-01-06 8:06 ` Pengyu Luo
2025-01-06 12:29 ` Krzysztof Kozlowski
2025-01-05 17:41 ` [PATCH v2 2/5] platform: arm64: add Huawei Matebook E Go EC driver Pengyu Luo
2025-01-07 12:25 ` Heikki Krogerus
2025-01-07 16:53 ` Pengyu Luo [this message]
2025-01-05 17:41 ` [PATCH v2 3/5] usb: typec: ucsi: add Huawei Matebook E Go ucsi driver Pengyu Luo
2025-01-07 12:30 ` Heikki Krogerus
2025-01-07 16:54 ` Pengyu Luo
2025-01-05 17:41 ` [PATCH v2 4/5] power: supply: add Huawei Matebook E Go psy driver Pengyu Luo
2025-01-05 17:41 ` [PATCH v2 5/5] arm64: dts: qcom: gaokun3: Add Embedded Controller node Pengyu Luo
2025-01-09 14:37 ` Konrad Dybcio
2025-01-06 19:27 ` [PATCH v2 0/5] platform: arm64: Huawei Matebook E Go embedded controller Rob Herring (Arm)
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=20250107165335.114744-1-mitltlatltl@gmail.com \
--to=mitltlatltl@gmail.com \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jdelvare@suse.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=platform-driver-x86@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sre@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox