lkml.org 
[lkml]   [2018]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [alsa-devel] [PATCH 2/2] ASoC: max98927: Add reset-gpio support
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, &reg);
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
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2018-09-20 13:39    [W:0.102 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site