Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp645067ybh; Wed, 18 Mar 2020 06:38:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsP2BcpgWBinvRVwdwUYcO4hzL/XVU+ehu5b9PDhUeWsugE29BomBTDrNTsk0ja71tOQnYK X-Received: by 2002:a9d:12b4:: with SMTP id g49mr4070406otg.50.1584538685916; Wed, 18 Mar 2020 06:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584538685; cv=none; d=google.com; s=arc-20160816; b=mNN9nnmdgGZ68su+RX6qNDW8tNGn2bFVSxRoofRltwenHpzJKkOAA2hkx4sQ+pQiBj +PmS/BYXtKlwHxVoXmnqGoHoCoAzNtvEVlaeZaUqN3itLPvpmAGYKPlB/OdKa7sVd/7V uj7GVAJ9b8KHEdmJzS/KyMjirwcFPvfFPsOZ57/G5j39r7L/tqCEetRBgbuFxplEYHvv e8VC6N1ClQtSZzwJWC/gM5JB+YlIEun1ceW+u+yHrEcIKS5J2IlxTcaQFDB4lOk2Tp7i p6vU+L8lzwSttqHjQGsV6Z6E4KfO4IKYrK+Vz5jMQoXxWsn4EIuv6u1PLsvhhn/RH4Dv Lzaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zuo61nM/MH+S9bbLW2vdQq9bZPHHpW6MvtuVuJlfvWw=; b=lvXbqW1tzPrVpNHQgc+UoNBaPYk3CH8c/riRNjDVvno6mVEfTI5s3+F2tQg4JF+9oF T5TwtDgQ+xPkYGxxgGJf39HXpZeVebT7N3FjQi9y+tuUjDPgzbExIa2N5p84kuvyA+WK bvUOmtUpXKJ7H6CgiRYmDoALBPUlzj3iMpX1pQjvPdi0fyh25mUQ2+1mcTyIA87srk6U uuLEQEUX+2q48lK0DpeD3zBBSFqF9OFosUKor2t4OrSfDSMTBRpuxRKG2IjsoRZ09iI3 /eizGzvbKbbebXY5bzOPob19raeGJ0LOmnBD6mDm/XfOJ+jQ9fhf1wkvFoIOb2HgoFmM Lo7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W0rWwlJN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5si3180338otk.178.2020.03.18.06.37.53; Wed, 18 Mar 2020 06:38:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W0rWwlJN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbgCRNhg (ORCPT + 99 others); Wed, 18 Mar 2020 09:37:36 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:32957 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbgCRNhf (ORCPT ); Wed, 18 Mar 2020 09:37:35 -0400 Received: by mail-wr1-f65.google.com with SMTP id a25so30458927wrd.0; Wed, 18 Mar 2020 06:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zuo61nM/MH+S9bbLW2vdQq9bZPHHpW6MvtuVuJlfvWw=; b=W0rWwlJN7lswrFIX9K9PmiIJNNjqcBkwNsVUqRB9cjH2QbEWw//6zD/YxGc22jwzQk MAWmTLj6kNhpytfmLADJPiFwKcto+npBanpNSfEID79+vYWm5JMeuelmWbEiPh/tliXv ytKm8R67Edsbi1I5iUjxQ4uTxA2E9DJxRRyxfkAlKBuE1c613/Za8cKU499CJ/X8fzgE Kz00OCshqp3RBPGRGCBUEPuG8xXMX0KSrdBRlLmtCg4287LtLKiVXd0GrZ7/huOiCikA cokppLLsaoHvsW+40gIh1pXEgD1GiVQkn7fhYFpwoFdpXXk8wU4RiP6TAvZd5GQrw1kP MG3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zuo61nM/MH+S9bbLW2vdQq9bZPHHpW6MvtuVuJlfvWw=; b=A01t3NrYnXs1jBusxV1RutdDj8Wg8Z0BSEIDD00mqlYt11sw+gkBng0vYOtJzqUrNj o1bBTv+2i9bcaLgT7mIA1kzAYDwDFJbG6QtFETMU5HF3EfHlLcmWD3uzt40Vm36260vT bbUGlgbkcgqs16/7kLvY9KZIa5iQWLWPb2bVoeBdbOQf40NI6NS6RHpOS4Hf7iUJX+CP x39s6ZuWiqIxTjIfKjl2Df3WgVtwX2/ymSyXc8LDy7KV/cOJAbKymeSi5jLBpwZwdwUD 81eNgG1UPmbt8oA4VXs2TKJf82wKS8pJXnL0n4atCppGNB9J43uNvrC6MGwPiaagGrwl CgpQ== X-Gm-Message-State: ANhLgQ2eGGV0PlSejXJrpS0oZ6Hd5oyCHcwS3CdNeFOEvU4/SfDvxyLc QOnA1bUKeV31BHt36pBm39uhT7z1 X-Received: by 2002:a5d:680f:: with SMTP id w15mr5670860wru.245.1584538653865; Wed, 18 Mar 2020 06:37:33 -0700 (PDT) Received: from saturn.lan ([188.26.73.247]) by smtp.gmail.com with ESMTPSA id f15sm9444002wru.83.2020.03.18.06.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 06:37:32 -0700 (PDT) From: Alexandru Ardelean X-Google-Original-From: Alexandru Ardelean To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael.Hennerich@analog.com, renatogeh@gmail.com, lars@metafoo.de, jic23@kernel.org, mircea.caprioru@analog.com, Alexandru Ardelean Subject: [PATCH 0/5] ad7780,ad7791,ad7793: localize all IIO channel macro defs Date: Wed, 18 Mar 2020 15:40:37 +0200 Message-Id: <20200318134042.30133-1-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset has 2 intents: 1. We've noticed with newer Sigma-Delta ADCs that the current standard macros (AD_SD_*_CHANNEL()) for defining IIO channels are too rigid when adding new parts that have some slight variations. Two examples that come to mind are AD7124 and AD7192; for the final version of the AD7192 one requirement was to set 'IIO_CHAN_INFO_SCALE' to 'info_mask_shared_by_type_available', which would require a new AD_SD_*_CHANNEL macro-set 2. Similarly to AD7192, for the AD7793 driver, there is a AD7797 part that doesn't need 'IIO_CHAN_INFO_SCALE' for 'info_mask_shared_by_type_available'. While other parts do need it. But the biggest problem in the AD7793 driver, is that we're getting checkpatch patches that try to fix/break the 'in_voltage-voltage_scale_available' sysfs attribute. So, to get that driver away from checkpatch's radar, the read_avail hook is used for AD7793. This patchset comes with a bit of code duplication, but as it seems, this duplication is easier to handle. Alexandru Ardelean (5): iio: adc: ad7780: define/use own IIO channel macros iio: adc: ad7791: define/use own IIO channel macros iio: adc: ad7793: define/use own IIO channel macros iio: ad_sigma_delta: remove unused IIO channel macros iio: adc: ad7793: use read_avail iio hook for scale available drivers/iio/adc/ad7780.c | 27 ++++- drivers/iio/adc/ad7791.c | 62 +++++++++-- drivers/iio/adc/ad7793.c | 142 ++++++++++++++++++------- include/linux/iio/adc/ad_sigma_delta.h | 58 ---------- 4 files changed, 182 insertions(+), 107 deletions(-) -- 2.20.1