All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v5 07/10] hda: cs35l41: Add support for CS35L41 in HDA systems
Date: Fri, 17 Dec 2021 00:29:09 +0800	[thread overview]
Message-ID: <202112170043.mK2wMAmZ-lkp@intel.com> (raw)
In-Reply-To: <20211216114332.153409-8-tanureal@opensource.cirrus.com>

[-- Attachment #1: Type: text/plain, Size: 9709 bytes --]

Hi Lucas,

I love your patch! Yet something to improve:

[auto build test ERROR on next-20211215]
[cannot apply to broonie-sound/for-next tiwai-sound/for-next rafael-pm/linux-next linus/master v5.16-rc5 v5.16-rc4 v5.16-rc3 v5.16-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Lucas-Tanure/Add-support-for-CS35L41-in-HDA-systems/20211216-194807
base:    93bf6eee76c0e716f6b32de690b1c52991547bb4
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20211217/202112170043.mK2wMAmZ-lkp(a)intel.com/config)
compiler: sh4-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/40112a770ed88d6d545d83a800fb9b125204272a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Lucas-Tanure/Add-support-for-CS35L41-in-HDA-systems/20211216-194807
        git checkout 40112a770ed88d6d545d83a800fb9b125204272a
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sh SHELL=/bin/bash sound/pci/hda/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

>> sound/pci/hda/cs35l41_hda.c:180:5: warning: no previous prototype for 'cs35l41_hda_bind' [-Wmissing-prototypes]
     180 | int cs35l41_hda_bind(struct device *dev, struct device *master, void *master_data)
         |     ^~~~~~~~~~~~~~~~
   sound/pci/hda/cs35l41_hda.c: In function 'cs35l41_hda_read_acpi':
>> sound/pci/hda/cs35l41_hda.c:315:59: error: invalid use of undefined type 'struct acpi_device'
     315 |         cs35l41->reset_gpio = fwnode_gpiod_get_index(&adev->fwnode, "reset", cs35l41->index,
         |                                                           ^~


vim +315 sound/pci/hda/cs35l41_hda.c

   179	
 > 180	int cs35l41_hda_bind(struct device *dev, struct device *master, void *master_data)
   181	{
   182		struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
   183		struct hda_component *comps = master_data;
   184	
   185		if (comps && cs35l41->index >= 0 && cs35l41->index < HDA_MAX_COMPONENTS)
   186			comps = &comps[cs35l41->index];
   187		else
   188			return -EINVAL;
   189	
   190		if (!comps->dev) {
   191			comps->dev = dev;
   192			strscpy(comps->name, dev_name(dev), sizeof(comps->name));
   193			comps->playback_hook = cs35l41_hda_playback_hook;
   194			comps->set_channel_map = cs35l41_hda_channel_map;
   195			return 0;
   196		}
   197	
   198		return -EBUSY;
   199	}
   200	
   201	static void cs35l41_hda_unbind(struct device *dev, struct device *master, void *master_data)
   202	{
   203		struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
   204		struct hda_component *comps = master_data;
   205	
   206		if (comps[cs35l41->index].dev == dev)
   207			memset(&comps[cs35l41->index], 0, sizeof(*comps));
   208	}
   209	
   210	static const struct component_ops cs35l41_hda_comp_ops = {
   211		.bind = cs35l41_hda_bind,
   212		.unbind = cs35l41_hda_unbind,
   213	};
   214	
   215	static int cs35l41_hda_apply_properties(struct cs35l41_hda *cs35l41,
   216						const struct cs35l41_hda_hw_config *hw_cfg)
   217	{
   218		bool internal_boost = false;
   219		int ret;
   220	
   221		if (!hw_cfg) {
   222			cs35l41->reg_seq = &cs35l41_hda_reg_seq_no_bst;
   223			return 0;
   224		}
   225	
   226		if (hw_cfg->bst_ind || hw_cfg->bst_cap || hw_cfg->bst_ipk)
   227			internal_boost = true;
   228	
   229		switch (hw_cfg->gpio1_func) {
   230		case CS35l41_VSPK_SWITCH:
   231			regmap_update_bits(cs35l41->regmap, CS35L41_GPIO_PAD_CONTROL,
   232					   CS35L41_GPIO1_CTRL_MASK, 1 << CS35L41_GPIO1_CTRL_SHIFT);
   233			break;
   234		case CS35l41_SYNC:
   235			regmap_update_bits(cs35l41->regmap, CS35L41_GPIO_PAD_CONTROL,
   236					   CS35L41_GPIO1_CTRL_MASK, 2 << CS35L41_GPIO1_CTRL_SHIFT);
   237			break;
   238		}
   239	
   240		switch (hw_cfg->gpio2_func) {
   241		case CS35L41_INTERRUPT:
   242			regmap_update_bits(cs35l41->regmap, CS35L41_GPIO_PAD_CONTROL,
   243					   CS35L41_GPIO2_CTRL_MASK, 2 << CS35L41_GPIO2_CTRL_SHIFT);
   244			break;
   245		}
   246	
   247		if (internal_boost) {
   248			cs35l41->reg_seq = &cs35l41_hda_reg_seq_int_bst;
   249			if (!(hw_cfg->bst_ind && hw_cfg->bst_cap && hw_cfg->bst_ipk))
   250				return -EINVAL;
   251			ret = cs35l41_boost_config(cs35l41->dev, cs35l41->regmap,
   252						   hw_cfg->bst_ind, hw_cfg->bst_cap, hw_cfg->bst_ipk);
   253			if (ret)
   254				return ret;
   255		} else {
   256			cs35l41->reg_seq = &cs35l41_hda_reg_seq_ext_bst;
   257		}
   258	
   259		ret = cs35l41_hda_channel_map(cs35l41->dev, 0, NULL, 1, (unsigned int *)&hw_cfg->spk_pos);
   260		if (ret)
   261			return ret;
   262	
   263		return 0;
   264	}
   265	
   266	static struct cs35l41_hda_hw_config *cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41,
   267								   const char *hid, int id)
   268	{
   269		struct cs35l41_hda_hw_config *hw_cfg;
   270		u32 values[HDA_MAX_COMPONENTS];
   271		struct acpi_device *adev;
   272		struct device *acpi_dev;
   273		char *property;
   274		size_t nval;
   275		int i, ret;
   276	
   277		adev = acpi_dev_get_first_match_dev(hid, NULL, -1);
   278		if (!adev) {
   279			dev_err(cs35l41->dev, "Failed to find an ACPI device for %s\n", hid);
   280			return ERR_PTR(-ENODEV);
   281		}
   282	
   283		acpi_dev = get_device(acpi_get_first_physical_node(adev));
   284		acpi_dev_put(adev);
   285	
   286		property = "cirrus,dev-index";
   287		ret = device_property_count_u32(acpi_dev, property);
   288		if (ret <= 0)
   289			goto no_acpi_dsd;
   290	
   291		if (ret > ARRAY_SIZE(values)) {
   292			ret = -EINVAL;
   293			goto err;
   294		}
   295		nval = ret;
   296	
   297		ret = device_property_read_u32_array(acpi_dev, property, values, nval);
   298		if (ret)
   299			goto err;
   300	
   301		cs35l41->index = -1;
   302		for (i = 0; i < nval; i++) {
   303			if (values[i] == id) {
   304				cs35l41->index = i;
   305				break;
   306			}
   307		}
   308		if (cs35l41->index == -1) {
   309			dev_err(cs35l41->dev, "No index found in %s\n", property);
   310			ret = -ENODEV;
   311			goto err;
   312		}
   313	
   314		/* No devm_ version as CLSA0100, in no_acpi_dsd case, can't use devm version */
 > 315		cs35l41->reset_gpio = fwnode_gpiod_get_index(&adev->fwnode, "reset", cs35l41->index,
   316							     GPIOD_OUT_LOW, "cs35l41-reset");
   317	
   318		hw_cfg = kzalloc(sizeof(*hw_cfg), GFP_KERNEL);
   319		if (!hw_cfg) {
   320			ret = -ENOMEM;
   321			goto err;
   322		}
   323	
   324		property = "cirrus,speaker-position";
   325		ret = device_property_read_u32_array(acpi_dev, property, values, nval);
   326		if (ret)
   327			goto err_free;
   328		hw_cfg->spk_pos = values[cs35l41->index];
   329	
   330		property = "cirrus,gpio1-func";
   331		ret = device_property_read_u32_array(acpi_dev, property, values, nval);
   332		if (ret)
   333			goto err_free;
   334		hw_cfg->gpio1_func = values[cs35l41->index];
   335	
   336		property = "cirrus,gpio2-func";
   337		ret = device_property_read_u32_array(acpi_dev, property, values, nval);
   338		if (ret)
   339			goto err_free;
   340		hw_cfg->gpio2_func = values[cs35l41->index];
   341	
   342		property = "cirrus,boost-peak-milliamp";
   343		ret = device_property_read_u32_array(acpi_dev, property, values, nval);
   344		if (ret == 0)
   345			hw_cfg->bst_ipk = values[cs35l41->index];
   346	
   347		property = "cirrus,boost-ind-nanohenry";
   348		ret = device_property_read_u32_array(acpi_dev, property, values, nval);
   349		if (ret == 0)
   350			hw_cfg->bst_ind = values[cs35l41->index];
   351	
   352		property = "cirrus,boost-cap-microfarad";
   353		ret = device_property_read_u32_array(acpi_dev, property, values, nval);
   354		if (ret == 0)
   355			hw_cfg->bst_cap = values[cs35l41->index];
   356	
   357		put_device(acpi_dev);
   358	
   359		return hw_cfg;
   360	
   361	err_free:
   362		kfree(hw_cfg);
   363	err:
   364		put_device(acpi_dev);
   365		dev_err(cs35l41->dev, "Failed property %s: %d\n", property, ret);
   366	
   367		return ERR_PTR(ret);
   368	
   369	no_acpi_dsd:
   370		/*
   371		 * Device CLSA0100 doesn't have _DSD so a gpiod_get by the label reset won't work.
   372		 * And devices created by i2c-multi-instantiate don't have their device struct pointing to
   373		 * the correct fwnode, so acpi_dev must be used here
   374		 * And devm functions expect that the device requesting the resource has the correct
   375		 * fwnode
   376		 */
   377		if (strncmp(hid, "CLSA0100", 8) != 0)
   378			return ERR_PTR(-EINVAL);
   379	
   380		/* check I2C address to assign the index */
   381		cs35l41->index = id == 0x40 ? 0 : 1;
   382		cs35l41->reset_gpio = gpiod_get_index(acpi_dev, NULL, 0, GPIOD_OUT_HIGH);
   383		cs35l41->vspk_always_on = true;
   384		put_device(acpi_dev);
   385	
   386		return NULL;
   387	}
   388	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

  reply	other threads:[~2021-12-16 16:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 11:43 [PATCH v5 00/10] Add support for CS35L41 in HDA systems Lucas Tanure
2021-12-16 11:43 ` Lucas Tanure
2021-12-16 11:43 ` [PATCH v5 01/10] ASoC: cs35l41: Convert tables to shared source code Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure
2021-12-16 11:43 ` [PATCH v5 02/10] ASoC: cs35l41: Move cs35l41_otp_unpack to shared code Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure
2021-12-17 12:59   ` Cezary Rojewski
2021-12-17 12:59     ` Cezary Rojewski
2021-12-16 11:43 ` [PATCH v5 03/10] ASoC: cs35l41: Move power initializations to reg_sequence Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure
2021-12-16 11:43 ` [PATCH v5 04/10] ASoC: cs35l41: Create shared function for errata patches Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure
2021-12-16 11:43 ` [PATCH v5 05/10] ASoC: cs35l41: Create shared function for setting channels Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure
2021-12-16 11:43 ` [PATCH v5 06/10] ASoC: cs35l41: Create shared function for boost configuration Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure
2021-12-16 11:43 ` [PATCH v5 07/10] hda: cs35l41: Add support for CS35L41 in HDA systems Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure
2021-12-16 16:29   ` kernel test robot [this message]
2021-12-16 11:43 ` [PATCH v5 08/10] ACPI / scan: Create platform device for CLSA0100 and CSC3551 ACPI nodes Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure
2021-12-16 11:43 ` [PATCH v5 09/10] ALSA: hda/realtek: Add support for Legion 7 16ACHg6 laptop Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure
2021-12-16 11:43 ` [PATCH v5 10/10] ALSA: hda/realtek: Add CS35L41 support for Thinkpad laptops Lucas Tanure
2021-12-16 11:43   ` Lucas Tanure

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=202112170043.mK2wMAmZ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.