linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Lee Jones <lee.jones@linaro.org>
Cc: kbuild-all@lists.01.org,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Rob Herring <robh+dt@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	bcousson@baylibre.com, Tony Lindgren <tony@atomide.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 36/48] mfd: ti_am335x_tscadc: Add ADC1/magnetic reader support
Date: Wed, 29 Sep 2021 06:32:16 +0800	[thread overview]
Message-ID: <202109290654.q78br8Dx-lkp@intel.com> (raw)
In-Reply-To: <20210928133143.157329-37-miquel.raynal@bootlin.com>

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

Hi Miquel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on lee-mfd/for-mfd-next]
[also build test WARNING on jic23-iio/togreg robh/for-next v5.15-rc3 next-20210922]
[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/Miquel-Raynal/TI-AM437X-ADC1/20210928-213524
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: microblaze-randconfig-r033-20210928 (attached as .config)
compiler: microblaze-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/43a01cf6413f2be038b0d466c7c3f6f16b40e2c3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Miquel-Raynal/TI-AM437X-ADC1/20210928-213524
        git checkout 43a01cf6413f2be038b0d466c7c3f6f16b40e2c3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze 

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

All warnings (new ones prefixed by >>):

   drivers/mfd/ti_am335x_tscadc.c: In function 'ti_tscadc_probe':
>> drivers/mfd/ti_am335x_tscadc.c:124:31: warning: variable 'use_mag' set but not used [-Wunused-but-set-variable]
     124 |         bool use_tsc = false, use_mag = false;
         |                               ^~~~~~~
   In file included from drivers/mfd/ti_am335x_tscadc.c:20:
   drivers/mfd/ti_am335x_tscadc.c: At top level:
   include/linux/mfd/ti_am335x_tscadc.h:126:38: error: 'HZ_PER_MHZ' undeclared here (not in a function)
     126 | #define TSC_ADC_CLK             (3 * HZ_PER_MHZ)
         |                                      ^~~~~~~~~~
   drivers/mfd/ti_am335x_tscadc.c:354:28: note: in expansion of macro 'TSC_ADC_CLK'
     354 |         .target_clk_rate = TSC_ADC_CLK,
         |                            ^~~~~~~~~~~


vim +/use_mag +124 drivers/mfd/ti_am335x_tscadc.c

   114	
   115	static	int ti_tscadc_probe(struct platform_device *pdev)
   116	{
   117		struct ti_tscadc_dev *tscadc;
   118		struct resource *res;
   119		struct clk *clk;
   120		struct device_node *node;
   121		struct mfd_cell *cell;
   122		struct property *prop;
   123		const __be32 *cur;
 > 124		bool use_tsc = false, use_mag = false;
   125		u32 val;
   126		int err;
   127		int tscmag_wires = 0, adc_channels = 0, cell_idx = 0, total_channels;
   128		int readouts = 0, mag_tracks = 0;
   129	
   130		/* Allocate memory for device */
   131		tscadc = devm_kzalloc(&pdev->dev, sizeof(*tscadc), GFP_KERNEL);
   132		if (!tscadc)
   133			return -ENOMEM;
   134	
   135		tscadc->dev = &pdev->dev;
   136	
   137		if (!pdev->dev.of_node) {
   138			dev_err(&pdev->dev, "Could not find valid DT data.\n");
   139			return -EINVAL;
   140		}
   141	
   142		tscadc->data = of_device_get_match_data(&pdev->dev);
   143	
   144		if (ti_adc_with_touchscreen(tscadc)) {
   145			node = of_get_child_by_name(pdev->dev.of_node, "tsc");
   146			of_property_read_u32(node, "ti,wires", &tscmag_wires);
   147			of_property_read_u32(node, "ti,coordiante-readouts", &readouts);
   148			of_node_put(node);
   149			if (tscmag_wires)
   150				use_tsc = true;
   151		} else {
   152			/*
   153			 * When adding support for the magnetic stripe reader, here is
   154			 * the place to look for the number of tracks used from device
   155			 * tree. Let's default to 0 for now.
   156			 */
   157			mag_tracks = 0;
   158			tscmag_wires = mag_tracks * 2;
   159			if (tscmag_wires)
   160				use_mag = true;
   161		}
   162	
   163		node = of_get_child_by_name(pdev->dev.of_node, "adc");
   164		of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) {
   165			adc_channels++;
   166			if (val > 7) {
   167				dev_err(&pdev->dev, " PIN numbers are 0..7 (not %d)\n",
   168					val);
   169				of_node_put(node);
   170				return -EINVAL;
   171			}
   172		}
   173	
   174		of_node_put(node);
   175	
   176		total_channels = tscmag_wires + adc_channels;
   177		if (total_channels > 8) {
   178			dev_err(&pdev->dev, "Number of i/p channels more than 8\n");
   179			return -EINVAL;
   180		}
   181	
   182		if (total_channels == 0) {
   183			dev_err(&pdev->dev, "Need atleast one channel.\n");
   184			return -EINVAL;
   185		}
   186	
   187		if (use_tsc && (readouts * 2 + 2 + adc_channels > 16)) {
   188			dev_err(&pdev->dev, "Too many step configurations requested\n");
   189			return -EINVAL;
   190		}
   191	
   192		err = platform_get_irq(pdev, 0);
   193		if (err < 0)
   194			return err;
   195		else
   196			tscadc->irq = err;
   197	
   198		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   199		tscadc->tscadc_base = devm_ioremap_resource(&pdev->dev, res);
   200		if (IS_ERR(tscadc->tscadc_base))
   201			return PTR_ERR(tscadc->tscadc_base);
   202	
   203		tscadc->tscadc_phys_base = res->start;
   204		tscadc->regmap = devm_regmap_init_mmio(&pdev->dev,
   205						       tscadc->tscadc_base,
   206						       &tscadc_regmap_config);
   207		if (IS_ERR(tscadc->regmap)) {
   208			dev_err(&pdev->dev, "regmap init failed\n");
   209			return PTR_ERR(tscadc->regmap);
   210		}
   211	
   212		spin_lock_init(&tscadc->reg_lock);
   213		init_waitqueue_head(&tscadc->reg_se_wait);
   214	
   215		pm_runtime_enable(&pdev->dev);
   216		pm_runtime_get_sync(&pdev->dev);
   217	
   218		/*
   219		 * The TSC_ADC_Subsystem has 2 clock domains: OCP_CLK and ADC_CLK.
   220		 * ADCs produce a 12-bit sample every 15 ADC_CLK cycles.
   221		 * am33xx ADCs expect to capture 200ksps.
   222		 * am47xx ADCs expect to capture 867ksps.
   223		 * We need ADC clocks respectively running at 3MHz and 13MHz.
   224		 * These frequencies are valid since TSC_ADC_SS controller design
   225		 * assumes the OCP clock is at least 6x faster than the ADC clock.
   226		 */
   227		clk = devm_clk_get(&pdev->dev, NULL);
   228		if (IS_ERR(clk)) {
   229			dev_err(&pdev->dev, "failed to get fck\n");
   230			err = PTR_ERR(clk);
   231			goto err_disable_clk;
   232		}
   233	
   234		tscadc->clk_div = (clk_get_rate(clk) / tscadc->data->target_clk_rate) - 1;
   235		regmap_write(tscadc->regmap, REG_CLKDIV, tscadc->clk_div);
   236	
   237		/*
   238		 * Set the control register bits. tscadc->ctrl stores the configuration
   239		 * of the CTRL register but not the subsystem enable bit which must be
   240		 * added manually when timely.
   241		 */
   242		tscadc->ctrl = CNTRLREG_STEPID;
   243		if (ti_adc_with_touchscreen(tscadc)) {
   244			tscadc->ctrl |= CNTRLREG_TSC_STEPCONFIGWRT;
   245			if (use_tsc) {
   246				tscadc->ctrl |= CNTRLREG_TSC_ENB;
   247				if (tscmag_wires == 5)
   248					tscadc->ctrl |= CNTRLREG_TSC_5WIRE;
   249				else
   250					tscadc->ctrl |= CNTRLREG_TSC_4WIRE;
   251			}
   252		} else {
   253			tscadc->ctrl |= CNTRLREG_MAG_PREAMP_PWRDOWN |
   254					CNTRLREG_MAG_PREAMP_BYPASS;
   255		}
   256		regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl);
   257	
   258		tscadc_idle_config(tscadc);
   259	
   260		/* Enable the TSC module enable bit */
   261		regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_SSENB);
   262	
   263		/* TSC or MAG Cell */
   264		if (tscmag_wires > 0) {
   265			cell = &tscadc->cells[cell_idx++];
   266			cell->name = tscadc->data->secondary_feature_name;
   267			cell->of_compatible = tscadc->data->secondary_feature_compatible;
   268			cell->platform_data = &tscadc;
   269			cell->pdata_size = sizeof(tscadc);
   270		}
   271	
   272		/* ADC Cell */
   273		if (adc_channels > 0) {
   274			cell = &tscadc->cells[cell_idx++];
   275			cell->name = tscadc->data->adc_feature_name;
   276			cell->of_compatible = tscadc->data->adc_feature_compatible;
   277			cell->platform_data = &tscadc;
   278			cell->pdata_size = sizeof(tscadc);
   279		}
   280	
   281		err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
   282				      tscadc->cells, cell_idx, NULL, 0, NULL);
   283		if (err < 0)
   284			goto err_disable_clk;
   285	
   286		platform_set_drvdata(pdev, tscadc);
   287		return 0;
   288	
   289	err_disable_clk:
   290		pm_runtime_put_sync(&pdev->dev);
   291		pm_runtime_disable(&pdev->dev);
   292	
   293		return err;
   294	}
   295	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27076 bytes --]

  reply	other threads:[~2021-09-28 22:32 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 13:30 [PATCH v4 00/48] TI AM437X ADC1 Miquel Raynal
2021-09-28 13:30 ` [PATCH v4 01/48] clk: ti: am43xx: Add clkctrl data for am43xx ADC1 Miquel Raynal
2021-09-28 13:30 ` [PATCH v4 02/48] dt-bindings: mfd: ti,am3359-tscadc: Add a yaml description for this MFD Miquel Raynal
2021-09-28 13:30 ` [PATCH v4 03/48] dt-bindings: touchscreen: ti,am3359-tsc: New yaml description Miquel Raynal
2021-09-28 13:30 ` [PATCH v4 04/48] dt-bindings: iio: adc: ti,am3359-adc: " Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 05/48] dt-bindings: touchscreen: ti,am3359-tsc: Remove deprecated text file Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 06/48] dt-bindings: mfd: ti,am3359-tscadc: Describe am4372 MFD compatible Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 07/48] dt-bindings: iio: adc: ti,am3359-adc: Describe am4372 ADC compatible Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 08/48] mfd: ti_am335x_tscadc: Ensure a balanced number of node get/put Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 09/48] mfd: ti_am335x_tscadc: Replace license text with SPDX tag Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 10/48] mfd: ti_am335x_tscadc: Fix style Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 11/48] mfd: ti_am335x_tscadc: Drop extra spacing when declaring stack variables Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 12/48] mfd: ti_am335x_tscadc: Get rid of useless gotos Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 13/48] mfd: ti_am335x_tscadc: Reword the comment explaining the dividers Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 14/48] mfd: ti_am335x_tscadc: Don't search the tree for our clock Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 15/48] mfd: ti_am335x_tscadc: Simplify divisor calculation Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 16/48] mfd: ti_am335x_tscadc: Move the driver structure allocation earlier Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 17/48] mfd: ti_am335x_tscadc: Use driver data Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 18/48] mfd: ti_am335x_tscadc: Mimic the probe from resume() Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 19/48] mfd: ti_am335x_tscadc: Drop useless variables from the driver structure Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 20/48] mfd: ti_am335x_tscadc: Always provide an idle configuration Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 21/48] mfd: ti_am335x_tscadc: Reorder the initialization steps Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 22/48] mfd: ti_am335x_tscadc: Gather the ctrl register logic in one place Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 23/48] mfd: ti_am335x_tscadc: Replace the header license text with SPDX tag Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 24/48] mfd: ti_am335x_tscadc: Fix header spacing Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 25/48] mfd: ti_am335x_tscadc: Use the new HZ_PER_MHZ macro Miquel Raynal
2021-09-29 15:29   ` Jonathan Cameron
2021-10-01  7:11     ` Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 26/48] mfd: ti_am335x_tscadc: Drop unused definitions from the header Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 27/48] mfd: ti_am335x_tscadc: Use BIT(), GENMASK() and FIELD_PREP() when relevant Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 28/48] mfd: ti_am335x_tscadc: Clarify the maximum values for DT entries Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 29/48] mfd: ti_am335x_tscadc: Drop useless definitions from the header Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 30/48] mfd: ti_am335x_tscadc: Rename the subsystem enable macro Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 31/48] mfd: ti_am335x_tscadc: Add TSC prefix in certain macros Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 32/48] mfd: ti_am335x_tscadc: Rename a variable Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 33/48] mfd: ti_am335x_tscadc: Fix an error message Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 34/48] mfd: ti_am335x_tscadc: Add a boolean to clarify the presence of a touchscreen Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 35/48] mfd: ti_am335x_tscadc: Introduce a helper to deal with the type of hardware Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 36/48] mfd: ti_am335x_tscadc: Add ADC1/magnetic reader support Miquel Raynal
2021-09-28 22:32   ` kernel test robot [this message]
2021-10-01  7:26     ` Miquel Raynal
2021-10-01 18:15       ` Lee Jones
2021-09-28 13:31 ` [PATCH v4 37/48] mfd: ti_am335x_tscadc: Support the correctly spelled DT property Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 38/48] iio: adc: ti_am335x_adc: Wait the idle state to avoid stalls Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 39/48] iio: adc: ti_am335x_adc: Replace license text with SPDX tag Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 40/48] iio: adc: ti_am335x_adc: Fix style Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 41/48] iio: adc: ti_am335x_adc: Get rid of useless gotos Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 42/48] iio: adc: ti_am335x_adc: Gather the checks on the delays Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 43/48] iio: adc: ti_am335x_adc: Add a unit to the timeout delay Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 44/48] iio: adc: ti_am335x_adc: Add the scale information Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 45/48] iio: adc: ti_am335x_adc: Add the am437x compatible Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 46/48] ARM: dts: am437x-cm-t43: Use a correctly spelled DT property Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 47/48] ARM: dts: am43xx: Describe the magnetic reader/ADC1 hardware module Miquel Raynal
2021-09-28 13:31 ` [PATCH v4 48/48] ARM: dts: am437x-gp-evm: enable ADC1 Miquel Raynal

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=202109290654.q78br8Dx-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jic23@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=lars@metafoo.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.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).