From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Pengyu Luo <mitltlatltl@gmail.com>
Cc: "Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konradybcio@kernel.org>,
"Hans de Goede" <hdegoede@redhat.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
"Sebastian Reichel" <sre@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jean Delvare" <jdelvare@suse.com>,
"Guenter Roeck" <linux@roeck-us.net>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org,
linux-usb@vger.kernel.org, linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v3 2/6] platform: arm64: add Huawei Matebook E Go EC driver
Date: Thu, 16 Jan 2025 14:02:18 +0200 [thread overview]
Message-ID: <Z4j1SicBtMZq4P9B@kuha.fi.intel.com> (raw)
In-Reply-To: <20250113175049.590511-1-mitltlatltl@gmail.com>
Hi,
> +static void gaokun_ec_remove(struct i2c_client *client)
> +{
> + struct gaokun_ec *ec = i2c_get_clientdata(client);
> + hwmon_device_unregister(ec->hwmon_dev);
> +}
You are missing black line after the declaration.
> +static const struct i2c_device_id gaokun_ec_id[] = {
> + { "gaokun-ec", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(i2c, gaokun_ec_id);
> +
> +static const struct of_device_id gaokun_ec_of_match[] = {
> + { .compatible = "huawei,gaokun3-ec", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, gaokun_ec_of_match);
> +
> +static const struct dev_pm_ops gaokun_ec_pm_ops = {
> + NOIRQ_SYSTEM_SLEEP_PM_OPS(gaokun_ec_suspend, gaokun_ec_resume)
> +};
> +
> +static struct i2c_driver gaokun_ec_driver = {
> + .driver = {
> + .name = "gaokun-ec",
> + .of_match_table = gaokun_ec_of_match,
> + .pm = &gaokun_ec_pm_ops,
> + .dev_groups = gaokun_ec_groups,
> + },
> + .probe = gaokun_ec_probe,
> + .remove = gaokun_ec_remove,
> + .id_table = gaokun_ec_id,
> +};
> +module_i2c_driver(gaokun_ec_driver);
> +
> +MODULE_DESCRIPTION("HUAWEI Matebook E Go EC driver");
> +MODULE_AUTHOR("Pengyu Luo <mitltlatltl@gmail.com>");
> +MODULE_LICENSE("GPL");
> diff --git a/include/linux/platform_data/huawei-gaokun-ec.h b/include/linux/platform_data/huawei-gaokun-ec.h
> new file mode 100644
> index 000000000..dfd177bd9
> --- /dev/null
> +++ b/include/linux/platform_data/huawei-gaokun-ec.h
> @@ -0,0 +1,80 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Huawei Matebook E Go Embedded Controller
> + *
> + * Copyright (C) 2024 Pengyu Luo <mitltlatltl@gmail.com>
> + */
> +
> +#ifndef __HUAWEI_GAOKUN_EC_H__
> +#define __HUAWEI_GAOKUN_EC_H__
> +
> +#define GAOKUN_UCSI_CCI_SIZE 4
> +#define GAOKUN_UCSI_DATA_SIZE 16
> +#define GAOKUN_UCSI_READ_SIZE (GAOKUN_UCSI_CCI_SIZE + GAOKUN_UCSI_DATA_SIZE)
> +#define GAOKUN_UCSI_WRITE_SIZE 0x18
> +
> +#define GAOKUN_UCSI_NO_PORT_UPDATE (-1)
> +
> +#define GAOKUN_SMART_CHARGE_DATA_SIZE 4 /* mode, delay, start, end */
> +
> +/* -------------------------------------------------------------------------- */
> +
> +struct gaokun_ec;
> +struct gaokun_ucsi_reg;
> +struct notifier_block;
> +
> +#define GAOKUN_MOD_NAME "huawei_gaokun_ec"
> +#define GAOKUN_DEV_PSY "psy"
> +#define GAOKUN_DEV_UCSI "ucsi"
> +
> +/* -------------------------------------------------------------------------- */
> +/* Common API */
> +
> +int gaokun_ec_register_notify(struct gaokun_ec *ec,
> + struct notifier_block *nb);
> +void gaokun_ec_unregister_notify(struct gaokun_ec *ec,
> + struct notifier_block *nb);
> +
> +int gaokun_ec_read(struct gaokun_ec *ec, const u8 *req,
> + size_t resp_len, u8 *resp);
> +int gaokun_ec_write(struct gaokun_ec *ec, u8 *req);
> +int gaokun_ec_read_byte(struct gaokun_ec *ec, u8 *req, u8 *byte);
> +
> +/* -------------------------------------------------------------------------- */
> +/* API For PSY */
> +
> +int gaokun_ec_psy_multi_read(struct gaokun_ec *ec, u8 reg,
> + size_t resp_len, u8 *resp);
> +
> +static inline int gaokun_ec_psy_read_byte(struct gaokun_ec *ec,
> + u8 reg, u8 *byte)
> +{
> + return gaokun_ec_psy_multi_read(ec, reg, sizeof(*byte), byte);
> +}
> +
> +static inline int gaokun_ec_psy_read_word(struct gaokun_ec *ec,
> + u8 reg, u16 *word)
> +{
> + return gaokun_ec_psy_multi_read(ec, reg, sizeof(*word), (u8 *)word);
> +}
> +
> +int gaokun_ec_psy_get_smart_charge(struct gaokun_ec *ec,
> + u8 data[GAOKUN_SMART_CHARGE_DATA_SIZE]);
> +int gaokun_ec_psy_set_smart_charge(struct gaokun_ec *ec,
> + u8 data[GAOKUN_SMART_CHARGE_DATA_SIZE]);
> +
> +int gaokun_ec_psy_get_smart_charge_enable(struct gaokun_ec *ec, bool *on);
> +int gaokun_ec_psy_set_smart_charge_enable(struct gaokun_ec *ec, bool on);
> +
> +/* -------------------------------------------------------------------------- */
> +/* API For UCSI */
> +
> +int gaokun_ec_ucsi_read(struct gaokun_ec *ec, u8 resp[GAOKUN_UCSI_READ_SIZE]);
> +int gaokun_ec_ucsi_write(struct gaokun_ec *ec,
> + const u8 req[GAOKUN_UCSI_WRITE_SIZE]);
> +
> +int gaokun_ec_ucsi_get_reg(struct gaokun_ec *ec, struct gaokun_ucsi_reg *ureg);
> +int gaokun_ec_ucsi_pan_ack(struct gaokun_ec *ec, int port_id);
> +
> +
Here you have extra line.
scripts/checkpatch.pl should find this kind issues for you.
Br,
--
heikki
next prev parent reply other threads:[~2025-01-16 12:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 17:49 [PATCH v3 0/6] platform: arm64: Huawei Matebook E Go embedded controller Pengyu Luo
2025-01-13 17:50 ` [PATCH v3 2/6] platform: arm64: add Huawei Matebook E Go EC driver Pengyu Luo
2025-01-13 18:34 ` Guenter Roeck
2025-01-13 18:56 ` Ilpo Järvinen
2025-01-14 8:31 ` Pengyu Luo
2025-01-14 15:40 ` Ilpo Järvinen
2025-01-16 12:02 ` Heikki Krogerus [this message]
2025-01-13 17:51 ` [PATCH v3 3/6] usb: typec: ucsi: Add a macro definition for UCSI v1.0 Pengyu Luo
2025-01-13 17:51 ` [PATCH v3 4/6] usb: typec: ucsi: add Huawei Matebook E Go ucsi driver Pengyu Luo
2025-01-16 11:55 ` Heikki Krogerus
2025-01-16 18:26 ` Pengyu Luo
2025-01-13 17:51 ` [PATCH v3 5/6] power: supply: add Huawei Matebook E Go psy driver Pengyu Luo
2025-02-20 0:24 ` Sebastian Reichel
2025-02-20 6:43 ` Pengyu Luo
2025-02-21 1:33 ` Sebastian Reichel
2025-02-21 6:01 ` Pengyu Luo
2025-02-21 22:22 ` Sebastian Reichel
2025-02-22 11:27 ` Pengyu Luo
2025-01-13 17:51 ` [PATCH v3 6/6] arm64: dts: qcom: gaokun3: Add Embedded Controller node Pengyu Luo
2025-01-16 11:26 ` [PATCH v3 3/6] usb: typec: ucsi: Add a macro definition for UCSI v1.0 Heikki Krogerus
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=Z4j1SicBtMZq4P9B@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.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=mitltlatltl@gmail.com \
--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