From: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
dgreid@chromium.org, ryans.lee@maximintegrated.com,
Cheng-Yi Chiang <cychiang@chromium.org>
Subject: Re: [alsa-devel] [PATCH 2/2] ASoC: max98927: Add reset-gpio support
Date: Thu, 20 Sep 2018 19:36:37 +0800 [thread overview]
Message-ID: <201809201913.3T3u3Gey%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180912121955.33048-2-cychiang@chromium.org>
[-- Attachment #1: Type: text/plain, Size: 6544 bytes --]
Hi Cheng-Yi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.19-rc4 next-20180919]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Cheng-Yi-Chiang/ASoC-max9892x-Add-documentation-for-reset-gpio-support/20180914-010006
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: x86_64-randconfig-s3-09201857 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
sound/soc/codecs/max98927.c: In function 'max98927_i2c_toggle_reset':
>> sound/soc/codecs/max98927.c:884:2: error: implicit declaration of function 'gpiod_set_value_cansleep'; did you mean 'gpio_set_value_cansleep'? [-Werror=implicit-function-declaration]
gpiod_set_value_cansleep(max98927->reset_gpio, 1);
^~~~~~~~~~~~~~~~~~~~~~~~
gpio_set_value_cansleep
>> sound/soc/codecs/max98927.c:902:2: error: implicit declaration of function 'devm_gpiod_put'; did you mean 'devm_gpio_free'? [-Werror=implicit-function-declaration]
devm_gpiod_put(dev, max98927->reset_gpio);
^~~~~~~~~~~~~~
devm_gpio_free
sound/soc/codecs/max98927.c: In function 'max98927_i2c_probe':
>> sound/soc/codecs/max98927.c:950:25: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_gpio_request_one'? [-Werror=implicit-function-declaration]
max98927->reset_gpio = devm_gpiod_get_optional(
^~~~~~~~~~~~~~~~~~~~~~~
devm_gpio_request_one
>> sound/soc/codecs/max98927.c:951:24: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'?
&i2c->dev, "reset", GPIOD_OUT_LOW);
^~~~~~~~~~~~~
GPIOF_INIT_LOW
sound/soc/codecs/max98927.c:951:24: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
vim +884 sound/soc/codecs/max98927.c
873
874 static int max98927_i2c_toggle_reset(struct device *dev,
875 struct max98927_priv *max98927)
876 {
877 /*
878 * If we do not have reset gpio, assume platform firmware
879 * controls the regulator and toggles it for us.
880 */
881 if (!max98927->reset_gpio)
882 return 0;
883
> 884 gpiod_set_value_cansleep(max98927->reset_gpio, 1);
885
886 /*
887 * We need to wait a bit before we are allowed to release reset GPIO.
888 */
889 usleep_range(MAX98927_MIN_RESET_US, MAX98927_MIN_RESET_US + 5);
890
891 gpiod_set_value_cansleep(max98927->reset_gpio, 0);
892
893 /*
894 * We need to wait a bit before I2C communication is available.
895 */
896 usleep_range(MAX98927_RELEASE_RESET_DELAY_US,
897 MAX98927_RELEASE_RESET_DELAY_US + 5);
898
899 /*
900 * Release reset GPIO because we are not going to use it.
901 */
> 902 devm_gpiod_put(dev, max98927->reset_gpio);
903
904 return 0;
905 }
906
907 static bool max98927_is_first_to_reset(struct max98927_priv *max98927)
908 {
909 struct max98927_priv *p;
910
911 if (!max98927->reset_gpio)
912 return false;
913
914 list_for_each_entry(p, &reset_list, list) {
915 if (max98927->reset_gpio == p->reset_gpio)
916 return false;
917 }
918
919 return true;
920 }
921
922 static int max98927_i2c_probe(struct i2c_client *i2c,
923 const struct i2c_device_id *id)
924 {
925
926 int ret = 0, value;
927 int reg = 0;
928 struct max98927_priv *max98927 = NULL;
929
930 max98927 = devm_kzalloc(&i2c->dev,
931 sizeof(*max98927), GFP_KERNEL);
932
933 if (!max98927) {
934 ret = -ENOMEM;
935 return ret;
936 }
937 i2c_set_clientdata(i2c, max98927);
938
939 /* update interleave mode info */
940 if (!of_property_read_u32(i2c->dev.of_node,
941 "interleave_mode", &value)) {
942 if (value > 0)
943 max98927->interleave_mode = 1;
944 else
945 max98927->interleave_mode = 0;
946 } else
947 max98927->interleave_mode = 0;
948
949 /* Gets optional GPIO for reset line. */
> 950 max98927->reset_gpio = devm_gpiod_get_optional(
> 951 &i2c->dev, "reset", GPIOD_OUT_LOW);
952 if (IS_ERR(max98927->reset_gpio)) {
953 ret = PTR_ERR(max98927->reset_gpio);
954 dev_err(&i2c->dev, "error getting reset gpio: %d\n", ret);
955 return ret;
956 }
957
958 /*
959 * Only toggle reset line for the first instance when the
960 * reset line is shared among instances. For example,
961 * left and right amplifier share the same reset line, and
962 * we should only toggle the reset line once.
963 */
964 if (max98927_is_first_to_reset(max98927)) {
965 dev_info(&i2c->dev, "%s: toggle reset line\n", __func__);
966 ret = max98927_i2c_toggle_reset(&i2c->dev, max98927);
967 if (ret)
968 return ret;
969 }
970
971 /* regmap initialization */
972 max98927->regmap
973 = devm_regmap_init_i2c(i2c, &max98927_regmap);
974 if (IS_ERR(max98927->regmap)) {
975 ret = PTR_ERR(max98927->regmap);
976 dev_err(&i2c->dev,
977 "Failed to allocate regmap: %d\n", ret);
978 return ret;
979 }
980
981 /* Check Revision ID */
982 ret = regmap_read(max98927->regmap,
983 MAX98927_R01FF_REV_ID, ®);
984 if (ret < 0) {
985 dev_err(&i2c->dev,
986 "Failed to read: 0x%02X\n", MAX98927_R01FF_REV_ID);
987 return ret;
988 }
989 dev_info(&i2c->dev, "MAX98927 revisionID: 0x%02X\n", reg);
990
991 /* voltage/current slot configuration */
992 max98927_slot_config(i2c, max98927);
993
994 /* codec registeration */
995 ret = devm_snd_soc_register_component(&i2c->dev,
996 &soc_component_dev_max98927,
997 max98927_dai, ARRAY_SIZE(max98927_dai));
998 if (ret < 0)
999 dev_err(&i2c->dev, "Failed to register component: %d\n", ret);
1000
1001 list_add(&max98927->list, &reset_list);
1002
1003 return ret;
1004 }
1005
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26905 bytes --]
next prev parent reply other threads:[~2018-09-20 11:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 12:19 [PATCH 1/2] ASoC: max9892x: Add documentation for reset-gpio support Cheng-Yi Chiang
2018-09-12 12:19 ` [PATCH 2/2] ASoC: max98927: Add " Cheng-Yi Chiang
2018-09-12 16:47 ` [alsa-devel] " Rohit Kumar
2018-09-17 9:00 ` Cheng-yi Chiang
2018-09-17 17:47 ` Mark Brown
2018-09-20 11:36 ` kbuild test robot [this message]
2018-09-20 16:19 ` Mark Brown
2018-10-09 13:46 ` Cheng-yi Chiang
2018-10-12 10:05 ` Philipp Zabel
2018-10-12 13:46 ` Maxime Ripard
2018-10-17 17:02 ` Philipp Zabel
2018-11-20 1:19 ` Cheng-yi Chiang
2018-09-12 12:28 ` [PATCH 1/2] ASoC: max9892x: Add documentation for " Mark Brown
2018-09-13 4:25 ` Cheng-yi Chiang
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=201809201913.3T3u3Gey%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cychiang@chromium.org \
--cc=dgreid@chromium.org \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ryans.lee@maximintegrated.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;
as well as URLs for NNTP newsgroup(s).