Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp683758rwb; Wed, 7 Dec 2022 03:53:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf4QcF5MejuDu6RVIcnab8mjO0ZCySuZ+cLqAB7vPIzm0eqESBis91RwMYzT8s6GMWCXFb/A X-Received: by 2002:aa7:dd45:0:b0:45a:3c66:b0e4 with SMTP id o5-20020aa7dd45000000b0045a3c66b0e4mr82586708edw.33.1670414029559; Wed, 07 Dec 2022 03:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670414029; cv=none; d=google.com; s=arc-20160816; b=i+YHPONdumrHhf4k5k6sZKL1s9WgnknUM+m1YZvzAkuDPJzR1obIqBQZMxRGqjgS3w bRwcmgeTepRusdULW16WkXD7DqPnCQhYPD3uvAWGEuzy2sFer7LvHpgOwFvNNg6M/G9d H1a0Srujaam2+sVmsEHwwzW+pmIdWdcg4gO6HZlFEy1nywSV3VUjUGWQ6yEManLr2Ofc WqaM0Ncezy+G71rbp1cIhQACKtfj89O8vOmczgH2nB9hvWxn1wbQz2Y7myJQCOUiqizu N20+URHipvD/uVnExH9fz4QvooFsnX1npfsptURPlNElVl9Jrqk7keUloea+JZBfE5Yp 1EeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Sx//bsbxW2Yerq2W72EBv/UB5R1Vd7P7bAqCHysjt8o=; b=KEXLCu28T7qy/aZfp6+A9eoDaT6atuxjTsRrnUAhcawcxdrC8F7DOhnbZX5SiThjHf Wf6x1dbudVHq1fCzqPII8oDYKBiIqZ7s4TbGKCf24pF9smGiVHreYFYGemOBXnZYKZ/r zZmyRhmHeml0cdaiafx0luDu8Jf+CqHRlnbhT3FG5+ks+8VfM2gqUg+l3REAe2Kibxt8 9xjluIZXm5pmp5qdmEaJqohZGlCZCoERbHl58ycsNLaCIbYIxai0mdjMImtGthhM4uh9 GqqaqTBVgNgRKv+U6Wc3iPb305/4a7/wV2fwnJPN12R1prEm5wvRlKzG2ywY1v60Dptd CJ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gR+j7MNP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mm6-20020a170906cc4600b007c0d6b34c2bsi7511935ejb.647.2022.12.07.03.53.30; Wed, 07 Dec 2022 03:53:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gR+j7MNP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230058AbiLGLa3 (ORCPT + 77 others); Wed, 7 Dec 2022 06:30:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbiLGLaZ (ORCPT ); Wed, 7 Dec 2022 06:30:25 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E221748401; Wed, 7 Dec 2022 03:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670412624; x=1701948624; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=kh4y6l6w9SxnJx5xFBJLdTUfM4uJK7lKR1XZ4zn7eHc=; b=gR+j7MNPRcvLGUula5OrV8AG48OpuYijt2nQcMbdILnUdzBXq/H/EI2x FXOEc/SONQlf3VdCbHt/LPE1uD/uS441HxkeO34r+NWfZaN206sjwqK25 w/VQX4Gf9LGLJVgyw5i4eIaxpdOqrLO0L30IBgdFCMNsgKLwGiaLgg8wX ceOhidlWKDm8LLfARkEWXEYm6kOjJ9msr7YdQIGMeyUMrRBjBvvRDUBW2 3vf3CJ1dblmGSkMJYs0SoYvlSSasCDSWWBsyWgeownkCwCXLyhbX843C4 3eSWZxe8PaH0sUoTv3ua7tEGqv4MeOP5fKA3BS5/T22Be3Y3F00aqnbZg A==; X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="381161641" X-IronPort-AV: E=Sophos;i="5.96,225,1665471600"; d="scan'208";a="381161641" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2022 03:30:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="820928509" X-IronPort-AV: E=Sophos;i="5.96,225,1665471600"; d="scan'208";a="820928509" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga005.jf.intel.com with ESMTP; 07 Dec 2022 03:30:19 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p2scz-005k27-02; Wed, 07 Dec 2022 13:30:17 +0200 Date: Wed, 7 Dec 2022 13:30:16 +0200 From: Andy Shevchenko To: Okan Sahin Cc: outreachy@lists.linux.dev, Lee Jones , Rob Herring , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Jonathan Cameron , Lars-Peter Clausen , ChiYuan Huang , Lad Prabhakar , Caleb Connolly , Anand Ashok Dumbre , Ramona Bolboaca , William Breathitt Gray , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org Subject: Re: [PATCH 5/5] staging: drivers: iio: adc: Adc MAX77541 ADC Support Message-ID: References: <20221207090906.5896-1-okan.sahin@analog.com> <20221207090906.5896-6-okan.sahin@analog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221207090906.5896-6-okan.sahin@analog.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 07, 2022 at 12:08:44PM +0300, Okan Sahin wrote: > This patch add adc support for MAX77541. > > The MAX77541 has an 8-bit Successive Approximation Register (SAR) ADC > with four multiplexers for supporting the telemetry feature Same comment as per patch 2. ... > +#include > +#include > +#include Hmm... > +#include > +#include > +#include > +#include ... > +enum { > + MAX77541_ADC_CH1_I = 0, > + MAX77541_ADC_CH2_I, > + MAX77541_ADC_CH3_I, > + MAX77541_ADC_CH6_I, > + > + MAX77541_ADC_IRQMAX_I, If it's a terminator, drop the trailing comma. > +}; ... > + case MAX77541_ADC_TEMP: > + *val = -273; I believe we have definition for this in units.h. Can you use it? > + *val2 = 0; > + return IIO_VAL_INT_PLUS_MICRO; > + } > +} ... > + *val = 0; > + > + if (reg_val == LOW_RANGE) > + *val2 = 6250; > + else if (reg_val == MID_RANGE) > + *val2 = 12500; > + else if (reg_val == HIGH_RANGE) > + *val2 = 25000; > + else > + return -EINVAL; Can it be provided as a table? ... > + *val = 0; > + > + if (reg_val == LOW_RANGE) > + *val2 = 6250; > + else if (reg_val == MID_RANGE) > + *val2 = 12500; > + else if (reg_val == HIGH_RANGE) > + *val2 = 25000; > + else > + return -EINVAL; Ditto. ... > + Redundant blank line. > +module_platform_driver(max77541_adc_driver); -- With Best Regards, Andy Shevchenko