Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.17 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796307906; b=3SiqVi1MSqjGYkwqCsNs7i132uKTOxggsu1Afnf9aKTYUSqJFNr2lyzwt8GfPF8JQ3oo t4oPFvLIkD41p25FhWa3PzQT9xRcS9XUI/1KwOTskVoHMh1kUSEfWsueyr/oYeQ3zuJQh cM713jqtpYd2HyX9SBysDPfV+Gaet6L2L+oDl8bi1Q7lA6JqNb9w4rvlhN/gNX4lQm98Q Bnjp/loGJ5iZI0Qeg5ujy2iGkWoxFdug1ga4TmBPDctKlh9tzcqgrX+Oz60YoJHN68nQX im9HA4IymYOxrUyahpDUfz20MyC2EKZG/QHUZmU0LNmhBAViDbLBSVjecBMBIwSCG0Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796307906; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=ud7Azi23PatsoLXYh/SARbl9H1wXfqqY2tY3NmLaT7Q=; b=WmspnVECJR6RPM1goQ90W7D+N7Qre3Y9goEr3XnPJBdmxx3sGHDnBFPGBscJ8dxRzJDP Y779BKTWhlQ/5qyKe0nOIVQeUVzXcqSWG0sePsxF0bCxM1UzvEW7z45CwqoYqijZiVO+Y tf5RiyEoEhVGGBOtP3RGh51Nfc8Lq6c6vI6vfkl5xEAi4sDMbgMgpD/Urre7KnONY3oxm f2QWNsRPxQu5bSeRyI0MMfVe8i2eJVFDIYz+UgWYM3gRS4DGZRFQgUE0pcgNgfuDxHMLg hIvTBnZzfy2U/apw3ETCDhy22/BJgSEo8Dwr6dLMDDvr/PsZO0sDlwg2Dk4x7fW/c+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=nU03HBAs; arc=none smtp.remote-ip=192.198.163.17 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 039DF606A322 for ; Thu, 3 Dec 2026 14:25:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 039DF606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=nU03HBAs DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796307906; x=1827843906; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ud7Azi23PatsoLXYh/SARbl9H1wXfqqY2tY3NmLaT7Q=; b=nU03HBAsA/brZB1iiehlPnUVn1/FIKzX2AnH5p5cIgBmiccx4r1Zauz5 LVLdN6sCiMQGIqOmGxD50tKhEuFi2VFt1XYrNPlTWCq9yuxRz0oJHtr+R AzDVK21VqRV7BHNhcTpJcsohmBnaJpXUS9vKe/utvUHCRywaisddS9r1H N3JMlxR5aPl7eyUCfKHjW2izIUCO315E1xT0pc8kkhvAkZTsOOa5NN2p1 TvTjTpbd8Ewl1sxuwMbYXVN+SGlN2IlQDs5655dNnlLqGK/nnyS27loXx OX7KYx/3gqx69EthukO058GT+qk0PIp0IJJssIiyrSjSV/uKP9Q2dNVMV Q==; X-CSE-ConnectionGUID: ckMpP6k5TeufUBMiO5cRxA== X-CSE-MsgGUID: aaCaHKllQR6yPrXMBXB+NA== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5278527" X-IronPort-AV: E=Sophos;i="6.29,248,1794902400"; d="scan'208";a="5278527" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 06:25:06 -0800 X-CSE-ConnectionGUID: 9Mx4KoP6R3yKOYpyY4DI/w== X-CSE-MsgGUID: YcqDqulGRiyhl7nMw8A/ug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,248,1794902400"; d="scan'208";a="5304991" Received: from inaky-mobl1.amr.corp.intel.com (HELO localhost) ([10.245.244.115]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 06:25:03 -0800 Date: Thu, 3 Dec 2026 16:25:01 +0200 From: Andy Shevchenko To: Jakkapong Saksrisuwan Cc: linux-iio@vger.kernel.org, jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, gizero@gmail.com Subject: Re: [PATCH] iio: adc: mcp320x: Fix scale of the MCP3301 Message-ID: References: <20261203041911.99384-1-me@jakkapong.dev> X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203041911.99384-1-me@jakkapong.dev> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Thu, Dec 03, 2026 at 11:19:11AM +0700, Jakkapong Saksrisuwan wrote: > mcp320x_read_raw() reports the scale as Vref / 2^resolution: it returns > Vref in mV and chip_info->resolution as an IIO_VAL_FRACTIONAL_LOG2 pair, > and the IIO core shifts right by the resolution. > > The sign bit of the MCP3301 should not be counted toward resolution, so > set it to 12. > Fixes: f686a36b4b79 ("iio: adc: mcp320x: Add support for mcp3301") > Link: http://ww1.microchip.com/downloads/en/DeviceDoc/21700E.pdf Use Datasheet: tag instead. ... > [mcp3301] = { > .channels = mcp3201_channels, > .num_channels = ARRAY_SIZE(mcp3201_channels), > - .resolution = 13 > + .resolution = 12 While at it, add trailing comma. Or may be add a patch that adds it to all chip_info entries. > }, -- With Best Regards, Andy Shevchenko