All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Shenghao Ding <shenghao-ding@ti.com>, tiwai@suse.de
Cc: oe-kbuild-all@lists.linux.dev, robh+dt@kernel.org,
	lgirdwood@gmail.com, perex@perex.cz,
	pierre-louis.bossart@linux.intel.com, kevin-lu@ti.com,
	13916275206@139.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, liam.r.girdwood@intel.com,
	mengdong.lin@intel.com, baojun.xu@ti.com,
	thomas.gfeller@q-drop.com, peeyush@ti.com, navada@ti.com,
	broonie@kernel.org, gentuser@gmail.com,
	Shenghao Ding <shenghao-ding@ti.com>
Subject: Re: [PATCH v3 1/2] ALSA: hda/tas2781: Add tas2781 HDA driver
Date: Thu, 17 Aug 2023 21:39:51 +0800	[thread overview]
Message-ID: <202308172137.SthCPFbA-lkp@intel.com> (raw)
In-Reply-To: <20230817082606.940-1-shenghao-ding@ti.com>

Hi Shenghao,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tiwai-sound/for-linus]
[also build test WARNING on linus/master v6.5-rc6]
[cannot apply to tiwai-sound/for-next next-20230817]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Shenghao-Ding/ALSA-hda-tas2781-Add-tas2781-HDA-driver/20230817-162901
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-linus
patch link:    https://lore.kernel.org/r/20230817082606.940-1-shenghao-ding%40ti.com
patch subject: [PATCH v3 1/2] ALSA: hda/tas2781: Add tas2781 HDA driver
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20230817/202308172137.SthCPFbA-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230817/202308172137.SthCPFbA-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308172137.SthCPFbA-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/irqflags.h:18,
                    from include/linux/spinlock.h:59,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:7,
                    from include/linux/slab.h:16,
                    from include/linux/resource_ext.h:11,
                    from include/linux/acpi.h:13,
                    from sound/pci/hda/tas2781_hda_i2c.c:9:
   arch/loongarch/include/asm/percpu.h:20:4: error: #error compiler support for the model attribute is necessary when a recent assembler is used
      20 | #  error compiler support for the model attribute is necessary when a recent assembler is used
         |    ^~~~~
   sound/pci/hda/tas2781_hda_i2c.c: In function 'tasdevice_set_profile_id':
>> sound/pci/hda/tas2781_hda_i2c.c:192:13: warning: variable 'val' set but not used [-Wunused-but-set-variable]
     192 |         int val, ret = 0;
         |             ^~~
   sound/pci/hda/tas2781_hda_i2c.c: In function 'tasdevice_program_put':
   sound/pci/hda/tas2781_hda_i2c.c:249:13: warning: variable 'val' set but not used [-Wunused-but-set-variable]
     249 |         int val, ret = 0;
         |             ^~~
   sound/pci/hda/tas2781_hda_i2c.c: In function 'tasdevice_config_put':
   sound/pci/hda/tas2781_hda_i2c.c:278:13: warning: variable 'val' set but not used [-Wunused-but-set-variable]
     278 |         int val, ret = 0;
         |             ^~~


vim +/val +192 sound/pci/hda/tas2781_hda_i2c.c

     8	
   > 9	#include <linux/acpi.h>
    10	#include <linux/crc8.h>
    11	#include <linux/crc32.h>
    12	#include <linux/efi.h>
    13	#include <linux/firmware.h>
    14	#include <linux/i2c.h>
    15	#include <linux/mod_devicetable.h>
    16	#include <linux/module.h>
    17	#include <linux/pm_runtime.h>
    18	#include <linux/regmap.h>
    19	#include <sound/hda_codec.h>
    20	#include <sound/soc.h>
    21	#include <sound/tas2781.h>
    22	#include <sound/tlv.h>
    23	#include <sound/tas2781-tlv.h>
    24	
    25	#include "hda_local.h"
    26	#include "hda_auto_parser.h"
    27	#include "hda_component.h"
    28	#include "hda_jack.h"
    29	#include "hda_generic.h"
    30	
    31	#define TASDEVICE_SPEAKER_CALIBRATION_SIZE	20
    32	
    33	/* No standard control callbacks for SNDRV_CTL_ELEM_IFACE_CARD
    34	 * Define two controls, one is Volume control callbacks, the other is
    35	 * flag setting control callbacks.
    36	 */
    37	
    38	/* Volume control callbacks for tas2781 */
    39	#define ACARD_SINGLE_RANGE_EXT_TLV(xname, xreg, xshift, xmin, xmax, xinvert, \
    40		xhandler_get, xhandler_put, tlv_array) \
    41	{	.iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = (xname),\
    42		.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
    43			 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
    44		.tlv.p = (tlv_array), \
    45		.info = snd_soc_info_volsw_range, \
    46		.get = xhandler_get, .put = xhandler_put, \
    47		.private_value = (unsigned long)&(struct soc_mixer_control) \
    48			{.reg = xreg, .rreg = xreg, .shift = xshift, \
    49			 .rshift = xshift, .min = xmin, .max = xmax, \
    50			 .invert = xinvert} }
    51	
    52	/* Flag control callbacks for tas2781 */
    53	#define ACARD_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
    54	{	.iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = xname, \
    55		.info = snd_ctl_boolean_mono_info, \
    56		.get = xhandler_get, .put = xhandler_put, \
    57		.private_value = xdata }
    58	
    59	enum calib_data {
    60		R0_VAL = 0,
    61		INV_R0,
    62		R0LOW,
    63		POWER,
    64		TLIM,
    65		CALIB_MAX
    66	};
    67	
    68	static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data)
    69	{
    70		struct tasdevice_priv *tas_priv = data;
    71		struct acpi_resource_i2c_serialbus *sb;
    72	
    73		if (i2c_acpi_get_i2c_resource(ares, &sb)) {
    74			if (tas_priv->ndev < TASDEVICE_MAX_CHANNELS &&
    75				sb->slave_address != TAS2781_GLOBAL_ADDR) {
    76				tas_priv->tasdevice[tas_priv->ndev].dev_addr =
    77					(unsigned int)sb->slave_address;
    78				tas_priv->ndev++;
    79			}
    80		}
    81		return 1;
    82	}
    83	
    84	static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid)
    85	{
    86		struct acpi_device *adev;
    87		struct device *physdev;
    88		LIST_HEAD(resources);
    89		const char *sub;
    90		int ret;
    91	
    92		adev = acpi_dev_get_first_match_dev(hid, NULL, -1);
    93		if (!adev) {
    94			dev_err(p->dev,
    95				"Failed to find an ACPI device for %s\n", hid);
    96			return -ENODEV;
    97		}
    98	
    99		ret = acpi_dev_get_resources(adev, &resources, tas2781_get_i2c_res, p);
   100		if (ret < 0)
   101			goto err;
   102	
   103		acpi_dev_free_resource_list(&resources);
   104		strscpy(p->dev_name, hid, sizeof(p->dev_name));
   105		physdev = get_device(acpi_get_first_physical_node(adev));
   106		acpi_dev_put(adev);
   107	
   108		/* No side-effect to the playback even if subsystem_id is NULL*/
   109		sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
   110		if (IS_ERR(sub))
   111			sub = NULL;
   112	
   113		p->acpi_subsystem_id = sub;
   114	
   115		put_device(physdev);
   116	
   117		return 0;
   118	
   119	err:
   120		dev_err(p->dev, "read acpi error, ret: %d\n", ret);
   121		put_device(physdev);
   122	
   123		return ret;
   124	}
   125	
   126	static void tas2781_hda_playback_hook(struct device *dev, int action)
   127	{
   128		struct tasdevice_priv *tas_priv = dev_get_drvdata(dev);
   129	
   130		dev_dbg(tas_priv->dev, "%s: action = %d\n", __func__, action);
   131		switch (action) {
   132		case HDA_GEN_PCM_ACT_OPEN:
   133			pm_runtime_get_sync(dev);
   134			mutex_lock(&tas_priv->codec_lock);
   135			tasdevice_tuning_switch(tas_priv, 0);
   136			mutex_unlock(&tas_priv->codec_lock);
   137			break;
   138		case HDA_GEN_PCM_ACT_CLOSE:
   139			mutex_lock(&tas_priv->codec_lock);
   140			tasdevice_tuning_switch(tas_priv, 1);
   141			mutex_unlock(&tas_priv->codec_lock);
   142	
   143			pm_runtime_mark_last_busy(dev);
   144			pm_runtime_put_autosuspend(dev);
   145			break;
   146		default:
   147			dev_dbg(tas_priv->dev, "Playback action not supported: %d\n",
   148				action);
   149			break;
   150		}
   151	}
   152	
   153	static int tasdevice_info_profile(struct snd_kcontrol *kcontrol,
   154				struct snd_ctl_elem_info *uinfo)
   155	{
   156		struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
   157	
   158		uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
   159		uinfo->count = 1;
   160		uinfo->value.integer.min = 0;
   161		uinfo->value.integer.max = tas_priv->rcabin.ncfgs - 1;
   162	
   163		return 0;
   164	}
   165	
   166	static int tasdevice_get_profile_id(struct snd_kcontrol *kcontrol,
   167				struct snd_ctl_elem_value *ucontrol)
   168	{
   169		struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
   170	
   171		ucontrol->value.integer.value[0] = tas_priv->rcabin.profile_cfg_id;
   172	
   173		return 0;
   174	}
   175	
   176	static int tasdevice_hda_clamp(int val, int max)
   177	{
   178		if (val > max)
   179			val = max;
   180	
   181		if (val < 0)
   182			val = 0;
   183		return val;
   184	}
   185	
   186	static int tasdevice_set_profile_id(struct snd_kcontrol *kcontrol,
   187			struct snd_ctl_elem_value *ucontrol)
   188	{
   189		struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
   190		int nr_profile = ucontrol->value.integer.value[0];
   191		int max = tas_priv->rcabin.ncfgs - 1;
 > 192		int val, ret = 0;
   193	
   194		val = tasdevice_hda_clamp(nr_profile, max);
   195	
   196		if (tas_priv->rcabin.profile_cfg_id != nr_profile) {
   197			tas_priv->rcabin.profile_cfg_id = nr_profile;
   198			ret = 1;
   199		}
   200	
   201		return ret;
   202	}
   203	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2023-08-17 13:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  8:26 [PATCH v3 1/2] ALSA: hda/tas2781: Add tas2781 HDA driver Shenghao Ding
2023-08-17  8:26 ` [PATCH v3 2/2] " Shenghao Ding
2023-08-17 13:39 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-08-18  8:55 [PATCH v3 1/2] " Shenghao Ding
2023-08-18 16:30 ` Pierre-Louis Bossart
2023-08-20  9:35   ` Takashi Iwai
2023-08-21 14:43     ` Pierre-Louis Bossart
2023-08-21 14:57       ` Takashi Iwai
2023-08-21 15:04         ` Pierre-Louis Bossart

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=202308172137.SthCPFbA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=13916275206@139.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=gentuser@gmail.com \
    --cc=kevin-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mengdong.lin@intel.com \
    --cc=navada@ti.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peeyush@ti.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=shenghao-ding@ti.com \
    --cc=thomas.gfeller@q-drop.com \
    --cc=tiwai@suse.de \
    /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.