From patchwork Mon Sep 2 13:08:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mircea Caprioru X-Patchwork-Id: 11126711 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C3201399 for ; Mon, 2 Sep 2019 13:09:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71D182168B for ; Mon, 2 Sep 2019 13:09:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=analog.onmicrosoft.com header.i=@analog.onmicrosoft.com header.b="PIETs5Qq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729950AbfIBNJ1 (ORCPT ); Mon, 2 Sep 2019 09:09:27 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:42896 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729729AbfIBNJ1 (ORCPT ); Mon, 2 Sep 2019 09:09:27 -0400 Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x82D96Ic016107; Mon, 2 Sep 2019 09:09:07 -0400 Received: from nam02-cy1-obe.outbound.protection.outlook.com (mail-cys01nam02lp2053.outbound.protection.outlook.com [104.47.37.53]) by mx0a-00128a01.pphosted.com with ESMTP id 2uqnt8b1wd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Sep 2019 09:08:43 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SJgPmHmpWc6shlfUgROUrLsP6Xt55blR/B2JNDY2KGy5Bs0uJlBEGUu7zJ3DX4/NE+onUcxC8j5Ss3aEMUwJq3GP2oigg16Vak6N4QDCAYJMCYON1P4mwrslmQOOifBIMXkkwXYiw9pvwtaWglpNCDi4wAHGSSk6KsYNYY4GDCN0jrvAwdrDqdvIOdFl+tHU4VDRkggM2jvvncky5yLuuSTA8cJ6KmhjImgk3q3B6pbEiY+Hcy0/kVPLySKQTBlOkxzG6tH8VD/8l30w4cojbvsOpIkFAKcQgLfaulW7XIykvkUynTv1hSXb92axcilU3cvz/ZjAwm6oVXgUaUeGyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9jwG4u59GQqLDzY0gYR/7m+TIzIvFpY9PHbvdvEYJ5o=; b=Vy5rc+9NqIikKeaikdTBpPXPz6Wsx6iO8G9jjd6jg0rxjyn3ci/+BZe88eFVbehnNg/fZJX4p/K5/eH2mlGb4z2nImEUUXnfbu7pkZGrgkscYnWhjCkQt+TkhPKQgkLwc0jtOddSA3iC9OkupT/JMbDLlr5glVu/AnsEZNZMj8nDGiIq51hM1z8+tXb+joyn/JRljqPwlF26MMNk4ZmdI4J8OmP6FckvEAG4mkbdGO3CChti7UUYXVoKkWU++RSd0b7rYgjApFT8cbv/Uy3mzt99flhL76msri4CkkDFovOYhMnxurcHUqW6gTSL5kc4NCJX5BicR3q3xQ1h+TxzSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 137.71.25.57) smtp.rcpttodomain=metafoo.de smtp.mailfrom=analog.com; dmarc=bestguesspass action=none header.from=analog.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector2-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9jwG4u59GQqLDzY0gYR/7m+TIzIvFpY9PHbvdvEYJ5o=; b=PIETs5Qq2xahs2UrJFC9Fd5ObtCU8BnmtckDfzFFcbFWQXy0jY9nCoRRincl7ox5l4vP+S098V369kXVJMt1iamd/aq0Xk/+pbascCO/dYhyUM/u3vGSl8Cn5JCTQ2mN4dT0wqQ+zdx+Vh6vv98uhKAZm436wlw1N3n7rxJth+Y= Received: from MWHPR03CA0040.namprd03.prod.outlook.com (2603:10b6:301:3b::29) by BYAPR03MB3576.namprd03.prod.outlook.com (2603:10b6:a02:aa::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.22; Mon, 2 Sep 2019 13:08:40 +0000 Received: from BL2NAM02FT037.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::205) by MWHPR03CA0040.outlook.office365.com (2603:10b6:301:3b::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2220.20 via Frontend Transport; Mon, 2 Sep 2019 13:08:39 +0000 Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta2.analog.com; Received: from nwd2mta2.analog.com (137.71.25.57) by BL2NAM02FT037.mail.protection.outlook.com (10.152.77.11) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2220.16 via Frontend Transport; Mon, 2 Sep 2019 13:08:39 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id x82D8cLQ027133 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 2 Sep 2019 06:08:39 -0700 Received: from mircea-Latitude-E6540.ad.analog.com (10.48.65.107) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Mon, 2 Sep 2019 09:08:38 -0400 From: Mircea Caprioru To: CC: , , , , , , , , Mircea Caprioru Subject: [PATCH V4 1/4] iio: adc: ad7192: Add sysfs ABI documentation Date: Mon, 2 Sep 2019 16:08:28 +0300 Message-ID: <20190902130831.23057-1-mircea.caprioru@analog.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(346002)(39860400002)(136003)(396003)(2980300002)(199004)(189003)(54534003)(2906002)(2351001)(426003)(356004)(6666004)(476003)(126002)(486006)(6916009)(70206006)(47776003)(70586007)(2616005)(478600001)(50466002)(316002)(16586007)(186003)(48376002)(36756003)(26005)(106002)(54906003)(336012)(1076003)(50226002)(107886003)(8936002)(5660300002)(246002)(305945005)(7696005)(4326008)(86362001)(7636002)(51416003)(8676002)(44832011);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR03MB3576;H:nwd2mta2.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 639eea12-509e-46e1-72a3-08d72fa6ac0d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(4709080)(1401327)(4618075)(2017052603328);SRVR:BYAPR03MB3576; X-MS-TrafficTypeDiagnostic: BYAPR03MB3576: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 01480965DA X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: tR+tdaTGHpvXtQcY/uEYV1Ypzn7+27NcSVI1QgRioBfFpRE+mEkla0neCyH1ADmPh7KykRSNmxsk3igyr/qiQyJlxQY5Co7WcQ0bzk9vyTcdiH2zCUVuGhnvbrKAHuCDdV5Yc2BqmN4Yn3WKle94Q3BFjumsaY9n/+oIFdRpBAP74T6FltoAmsRsycS6A4Dmd1IrZROf04CF6FtnGkA3RJBAALi4Gdm/awZ6n7BvLTMREL/EH/ATDdcGrO1VsdjWId+PmECYnEscWE4MiCNtxvxGMH6k0pTlrjn0bzsaoFNHkqCFrEYaM4t3o5+kduwVP+Hztfm6/Yfq/MxkbBkzIrm41cglTe4Vp8pRoO3haDfkudj7OxZA5CKMLv7zAmxFJZOJB3koWH2CtzrTYDOt/1ZhpGmswx08nAmf3FyriSA= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2019 13:08:39.2872 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 639eea12-509e-46e1-72a3-08d72fa6ac0d X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB3576 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-02_04:2019-08-29,2019-09-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 suspectscore=1 lowpriorityscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1909020148 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Add initial ABI documentation for ad7192 adc sysfs interfaces. Signed-off-by: Mircea Caprioru --- Changelog V2: - no changes here Changelog V3: - no changes here Changelog V4: - added sysfs ABI documentation .../ABI/testing/sysfs-bus-iio-adc-ad7192 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 diff --git a/Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 b/Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 new file mode 100644 index 000000000000..74a2873045bf --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 @@ -0,0 +1,15 @@ +What: /sys/bus/iio/devices/iio:deviceX/ac_excitation_en +KernelVersion: +Contact: linux-iio@vger.kernel.org +Description: + Reading gives the state of AC excitation. + Writing '1' enables AC excitation. + +What: /sys/bus/iio/devices/iio:deviceX/bridge_switch_en +KernelVersion: +Contact: linux-iio@vger.kernel.org +Description: + This bridge switch is used to disconnect it when there is a + need to minimize the system current consumption. + Reading gives the state of the bridge switch. + Writing '1' enables the bridge switch. From patchwork Mon Sep 2 13:08:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mircea Caprioru X-Patchwork-Id: 11126707 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6C881399 for ; Mon, 2 Sep 2019 13:09:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E20E21881 for ; Mon, 2 Sep 2019 13:09:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=analog.onmicrosoft.com header.i=@analog.onmicrosoft.com header.b="daCuBBv2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729889AbfIBNJX (ORCPT ); Mon, 2 Sep 2019 09:09:23 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:35632 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729840AbfIBNJW (ORCPT ); Mon, 2 Sep 2019 09:09:22 -0400 Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x82CwbU4006770; Mon, 2 Sep 2019 09:08:59 -0400 Received: from nam04-co1-obe.outbound.protection.outlook.com (mail-co1nam04lp2053.outbound.protection.outlook.com [104.47.45.53]) by mx0a-00128a01.pphosted.com with ESMTP id 2uqjrab78q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Sep 2019 09:08:43 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GXR1Y8NLxYfUvUt4XuhaKxonP3Y4U0tjdR53X8hHtD9WXemsZYCBgwF8yTUI8kiGnU8QpGOsQCC0NaC4k3NU/9qGkGS2qXHkU2pqPfo0b5h/HhqOeBChDJ0Po6AMueThI6ODkiFp1p9ioYORXwtLT9zIAA9qujnO9cAr368m0CCXSV6lJWmkt7WEc+SGqYKhcIAToizvQyr6/YZHLWybOkycE45o0wdyNDLEuT1R9szUR9EpPJCTObbYdmUUW0eUvfnjfkNptiYFSKuKGZFKySTO+H22AZnRkA8FlMX8+ofEnmtgifI5bVn/nVQ+z/JGtWauJzPQ/Mv3zVrwy5QJQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DbXsXun/TgtVwLRfRUd8LK1u2JOGQ34IUP16JX0/1cc=; b=NZfWkTVW8xeR9zCsCqREw7vNopkQhLCScedwsixCrnt9O4GUNcV1LOATu2peCfdrvjrFSpZBtXSjfmWIvhvHMyEn+De8egES+up/R/ncAgri6xMjbL61PEy7r4NM0wtOBODg9e4398wpWZj3UACUAUMu11Gq4rA37cWPo+e8v6GskYK+bjQGQrnnw9DHOuLDc3rKo2hRftjTuzl0ApLqq1qlHumve7RpUD8nK8IjtFcuaxe7BnIORBwJ3FNlSYoBLmdaIP3cB5BB0Lgn0Urpym7fJQourHrSmBy1MB44WshFoI+FQzWAXMj9oKCwEleRcTMO4HSXCWSAafKksUL3Pg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 137.71.25.57) smtp.rcpttodomain=metafoo.de smtp.mailfrom=analog.com; dmarc=bestguesspass action=none header.from=analog.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector2-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DbXsXun/TgtVwLRfRUd8LK1u2JOGQ34IUP16JX0/1cc=; b=daCuBBv2W1aD0kdsw8bnNoFpYh2sLBMOIArzgsoTWA/WOn5SJ1Ibm2LisxgYnVH1LHH/dz/cWmFbcyyBUtRX2OBjJA9OQuSoD7/FKe4YK8WLSpfqkWHL4lZ/WSRaKLKMTO/BHb11V3VkaYWz/tWtSrrmP0ADTHWAmmR9z16j56Q= Received: from DM5PR03CA0034.namprd03.prod.outlook.com (2603:10b6:4:3b::23) by BN8PR03MB4852.namprd03.prod.outlook.com (2603:10b6:408:6a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.21; Mon, 2 Sep 2019 13:08:41 +0000 Received: from BL2NAM02FT018.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::208) by DM5PR03CA0034.outlook.office365.com (2603:10b6:4:3b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.16 via Frontend Transport; Mon, 2 Sep 2019 13:08:41 +0000 Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta2.analog.com; Received: from nwd2mta2.analog.com (137.71.25.57) by BL2NAM02FT018.mail.protection.outlook.com (10.152.77.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2220.16 via Frontend Transport; Mon, 2 Sep 2019 13:08:41 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id x82D8fr9027145 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 2 Sep 2019 06:08:41 -0700 Received: from mircea-Latitude-E6540.ad.analog.com (10.48.65.107) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Mon, 2 Sep 2019 09:08:40 -0400 From: Mircea Caprioru To: CC: , , , , , , , , Mircea Caprioru Subject: [PATCH V4 2/4] iio: adc: ad_sigma_delta: Export ad_sd_calibrate Date: Mon, 2 Sep 2019 16:08:29 +0300 Message-ID: <20190902130831.23057-2-mircea.caprioru@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190902130831.23057-1-mircea.caprioru@analog.com> References: <20190902130831.23057-1-mircea.caprioru@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(376002)(346002)(396003)(136003)(2980300002)(54534003)(189003)(199004)(6666004)(14444005)(50226002)(36756003)(48376002)(4326008)(107886003)(11346002)(50466002)(47776003)(356004)(44832011)(2616005)(486006)(126002)(476003)(246002)(54906003)(16586007)(186003)(7696005)(51416003)(2351001)(5660300002)(6916009)(76176011)(478600001)(446003)(336012)(305945005)(106002)(8676002)(8936002)(70586007)(70206006)(316002)(1076003)(86362001)(2906002)(426003)(7636002)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:BN8PR03MB4852;H:nwd2mta2.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 079ba56e-f9cc-4fe1-59c6-08d72fa6ad46 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(4709080)(1401327)(4618075)(2017052603328);SRVR:BN8PR03MB4852; X-MS-TrafficTypeDiagnostic: BN8PR03MB4852: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 01480965DA X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: M/JmO5QSPCI6X0Lt7OJcNv2CGxYJCZyhrQ0+vL/tFUCURwxzUzaizGMLMnQpgckpAuM2GuFHyM36U5FIVEw2V4DYxUP5tItgCJ5wk5GP6lbZCRHbkOODhBmOrFdUvB47x9Apnt5xZBxP3uUIuPd7ItX6w8BQyhe/SZ/Zs81fvUv9hLmvB9r9z3urxuVTKuo4UpP0x4YauV+kYCmYu5T2lapH+ReVE8gc2+kwGiuabqP5ISf+wdkJtOLuQnqRAblQeZXkjZEAp/jy4jyJ6XF+ekoXepeOtn59TEqxpGQD97RcMfUBogBy8xkuavfopFzVwpK1MP5WJ/MSjb5fADg/dPTivI5gKrqiC7hTbdH1RXHoWmiGmMp6X8TRvKkKXGRLIiyigF0rb3/Qn+P1nQ76SXKI69gnnRqFah/tnIfaehA= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2019 13:08:41.3369 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 079ba56e-f9cc-4fe1-59c6-08d72fa6ad46 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4852 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-02_04:2019-08-29,2019-09-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 spamscore=0 malwarescore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 adultscore=0 mlxscore=0 suspectscore=1 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1909020146 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org This patch exports the ad_sd_calibrate function in order to be able to call it from outside ad_sigma_delta. There are cases where the option to calibrate one channel at a time is necessary (ex. system calibration for zero scale and full scale). Signed-off-by: Mircea Caprioru --- Changelog V2: - no changes here Changelog V3: - no changes here Changelog V4: - no changes here drivers/iio/adc/ad_sigma_delta.c | 3 ++- include/linux/iio/adc/ad_sigma_delta.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index 2640b75fb774..8ba90486c787 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c @@ -205,7 +205,7 @@ int ad_sd_reset(struct ad_sigma_delta *sigma_delta, } EXPORT_SYMBOL_GPL(ad_sd_reset); -static int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta, +int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta, unsigned int mode, unsigned int channel) { int ret; @@ -242,6 +242,7 @@ static int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta, return ret; } +EXPORT_SYMBOL_GPL(ad_sd_calibrate); /** * ad_sd_calibrate_all() - Performs channel calibration diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h index 7716fa0c9fce..8a4e25a7080c 100644 --- a/include/linux/iio/adc/ad_sigma_delta.h +++ b/include/linux/iio/adc/ad_sigma_delta.h @@ -119,6 +119,8 @@ int ad_sd_reset(struct ad_sigma_delta *sigma_delta, int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, int *val); +int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta, + unsigned int mode, unsigned int channel); int ad_sd_calibrate_all(struct ad_sigma_delta *sigma_delta, const struct ad_sd_calib_data *cd, unsigned int n); int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev, From patchwork Mon Sep 2 13:08:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mircea Caprioru X-Patchwork-Id: 11126713 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9ECE41399 for ; Mon, 2 Sep 2019 13:09:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BDDB21881 for ; Mon, 2 Sep 2019 13:09:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=analog.onmicrosoft.com header.i=@analog.onmicrosoft.com header.b="zDiYdW6/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729840AbfIBNJm (ORCPT ); Mon, 2 Sep 2019 09:09:42 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:62904 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729844AbfIBNJl (ORCPT ); Mon, 2 Sep 2019 09:09:41 -0400 Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x82D9K23025679; Mon, 2 Sep 2019 09:09:20 -0400 Received: from nam05-co1-obe.outbound.protection.outlook.com (mail-co1nam05lp2050.outbound.protection.outlook.com [104.47.48.50]) by mx0a-00128a01.pphosted.com with ESMTP id 2uqjrab78s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 02 Sep 2019 09:09:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SKuCoyo0mCQO5b0Aas2zxB/KJ//33g0Sqy7ICcCvBw4I8cwSMYadsEs3TPMoEdDp6ThgOllNlj1NomubHx9d3w+s6zRN69o41l9naAKbYR9RRvg+I3Np0KdqixflGxk/gJfqa20n2qmAlU/ioWmAD3fmdnXauCywi9eJRkyginGVsYwPnppRZEb1gWrWzNQG/xWUFMOT6ZzhUxWZnhF9UEu39T3jGHyYZ4Ij5n2DxU++mX57n1g67f+/Cp3C2MJ6S1+X0nUd/C/PdZsOYty2lzT/ds/WPGl2uMpzhP3oIIeH8vzXqh+Q6XT7cD1snFJAXcVeTnfN1YzIAKeO4g+lkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6skLiWlEVitDs4Ban8ZjA0Xpm3/tfnOe/pHQRgSkZDA=; b=XVWogF0n+4TDfuqqNse/j+fMtwSNVvzUzWefP9nwkpFBZk0UQkdDIKNzoZRQURcdq0jmyaiT+BGpW4fLmZGcnO22IY6Jrh8jwOfTmU+At0LTYFAhef4xPq1QAsF3tSAYQXq3HFba+RqcnJHN7a2e5ICcCTjuOjNI29nx8P6gJ/9dKE6SEl1eEterHZUA9V4Bii3ZIneNLBoEfAta5T9DRw/XjHn0tm7gPZ8UXxHCTmt/UKHPZiT1tC+L3L81pOh3ZoUdxifaodayzUa/Gwuj2iI7cbo3wIfjizsehQBVnRIb8WVPjcJ/23c8eRnQgeXMulsDZ1MxzPvie9BcRALqpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 137.71.25.57) smtp.rcpttodomain=metafoo.de smtp.mailfrom=analog.com; dmarc=bestguesspass action=none header.from=analog.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector2-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6skLiWlEVitDs4Ban8ZjA0Xpm3/tfnOe/pHQRgSkZDA=; b=zDiYdW6/gNtBhrCwQOFi6TlkwC/rPuZBljW6c5tD1PI2nHMIylDBeo5BRcF47t3O/e/foMa/BndXYG6FqtmvgFMmd7HYDVV2eIVzK9ZHHiCGz3oZ3o1VYGgS1zB9gejpXUWRWsgpJIBi5mzg/M6Ki5Qi6/PQUqyvnTnsJMBNlcs= Received: from DM5PR03CA0057.namprd03.prod.outlook.com (2603:10b6:4:3b::46) by MN2PR03MB4816.namprd03.prod.outlook.com (2603:10b6:208:103::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.20; Mon, 2 Sep 2019 13:08:44 +0000 Received: from BL2NAM02FT019.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::201) by DM5PR03CA0057.outlook.office365.com (2603:10b6:4:3b::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2157.16 via Frontend Transport; Mon, 2 Sep 2019 13:08:43 +0000 Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta2.analog.com; Received: from nwd2mta2.analog.com (137.71.25.57) by BL2NAM02FT019.mail.protection.outlook.com (10.152.77.166) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2220.16 via Frontend Transport; Mon, 2 Sep 2019 13:08:43 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id x82D8hGS027158 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 2 Sep 2019 06:08:43 -0700 Received: from mircea-Latitude-E6540.ad.analog.com (10.48.65.107) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Mon, 2 Sep 2019 09:08:42 -0400 From: Mircea Caprioru To: CC: , , , , , , , , Mircea Caprioru Subject: [PATCH V4 3/4] staging: iio: adc: ad7192: Add system calibration support Date: Mon, 2 Sep 2019 16:08:30 +0300 Message-ID: <20190902130831.23057-3-mircea.caprioru@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190902130831.23057-1-mircea.caprioru@analog.com> References: <20190902130831.23057-1-mircea.caprioru@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(346002)(136003)(396003)(376002)(2980300002)(199004)(189003)(54534003)(47776003)(305945005)(126002)(2616005)(70586007)(44832011)(246002)(486006)(476003)(1076003)(51416003)(7696005)(36756003)(5660300002)(76176011)(70206006)(336012)(86362001)(50226002)(426003)(186003)(4326008)(54906003)(7636002)(26005)(446003)(2906002)(316002)(356004)(6666004)(16586007)(50466002)(8936002)(8676002)(48376002)(478600001)(107886003)(106002)(6916009)(14444005)(11346002)(2351001);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR03MB4816;H:nwd2mta2.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bbfddf1b-11e0-48c2-530c-08d72fa6ae8f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(4709080)(1401327)(4618075)(2017052603328);SRVR:MN2PR03MB4816; X-MS-TrafficTypeDiagnostic: MN2PR03MB4816: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 01480965DA X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: fgxPbBxGfZ91luHNBreh65Q2ihFMzWcTHV3C58kaOXz74n6adekf5sK2HE14koMvsd5jsOhAW9X46NcOcZyv3x3n+Qfpxrk5CjmczN5dK/KDeo4g0YQUTwgvl/A7mNhYa/aouSrjkXkxzUrFfFzTZN5YVlYfdhpn4XKXvisy+0QWMBmsaGFKx5ymUDGuJ+iKAI7MI8b7YdzUrXkCSMf4XgcoTWyqOn7Ar87w5VmiRF12Cs9QkdMzs8WmTXmTpnpB875pLDgIMm6NV5BPWei7Nf90yD9/zMOe4Gc8KhNV0cN5S8EOZvm0IqQAS7cPB//7mrIjb+epg4fcJcPnFWwJy3evTgp4VIBW4rVFa1lmug+VKqkXV1H/PAyb34AgnBqiJtCi92JsYl9GsmqCeLzw/eRhCNb8MFvhmmj0bWBOiwI= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2019 13:08:43.4708 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bbfddf1b-11e0-48c2-530c-08d72fa6ae8f X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB4816 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-02_04:2019-08-29,2019-09-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 spamscore=0 malwarescore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 adultscore=0 mlxscore=0 suspectscore=1 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1909020148 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org This patch will add a system calibration attribute for each channel. Using this option the user will have the ability to calibrate each channel for zero scale and full scale. It uses the iio_chan_spec_ext_info and IIO_ENUM to implement the functionality. Signed-off-by: Mircea Caprioru --- Changelog V2: - no changes here Changelog V3: - no changes here Changelog V4: - add an attribute to start the system calibration - the mode attribute does not trigger the calibration - added ABI documentation .../ABI/testing/sysfs-bus-iio-adc-ad7192 | 24 ++++++ drivers/staging/iio/adc/ad7192.c | 79 ++++++++++++++++++- 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 b/Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 index 74a2873045bf..7627d3be08f5 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 +++ b/Documentation/ABI/testing/sysfs-bus-iio-adc-ad7192 @@ -13,3 +13,27 @@ Description: need to minimize the system current consumption. Reading gives the state of the bridge switch. Writing '1' enables the bridge switch. + +What: /sys/bus/iio/devices/iio:deviceX/in_voltagex_sys_calibration +KernelVersion: +Contact: linux-iio@vger.kernel.org +Description: + Initiates the system calibration procedure. This is done on a + single channel at a time. Write '1' to start the calibration. + +What: /sys/bus/iio/devices/iio:deviceX/in_voltagex_sys_calibration_mode_available +KernelVersion: +Contact: linux-iio@vger.kernel.org +Description: + Reading returns a list with the possible calibration modes. + There are two available options: + "zero_scale" - calibrate to zero scale + "full_scale" - calibrate to full scale + +What: /sys/bus/iio/devices/iio:deviceX/in_voltagex_sys_calibration_mode +KernelVersion: +Contact: linux-iio@vger.kernel.org +Description: + Sets up the calibration mode used in the system calibration + procedure. Reading returns the current calibration mode. + Writing sets the system calibration mode. diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index d58ce08f3693..c5106d98c9b3 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -155,6 +155,11 @@ * The DOUT/RDY output must also be wired to an interrupt capable GPIO. */ +enum { + AD7192_SYSCALIB_ZERO_SCALE, + AD7192_SYSCALIB_FULL_SCALE, +}; + struct ad7192_state { struct regulator *avdd; struct regulator *dvdd; @@ -169,10 +174,80 @@ struct ad7192_state { u8 devid; u8 clock_sel; struct mutex lock; /* protect sensor state */ + u8 syscalib_mode[8]; struct ad_sigma_delta sd; }; +static const char * const ad7192_syscalib_modes[] = { + [AD7192_SYSCALIB_ZERO_SCALE] = "zero_scale", + [AD7192_SYSCALIB_FULL_SCALE] = "full_scale", +}; + +static int ad7192_set_syscalib_mode(struct iio_dev *indio_dev, + const struct iio_chan_spec *chan, + unsigned int mode) +{ + struct ad7192_state *st = iio_priv(indio_dev); + + st->syscalib_mode[chan->channel] = mode; + + return 0; +} + +static int ad7192_get_syscalib_mode(struct iio_dev *indio_dev, + const struct iio_chan_spec *chan) +{ + struct ad7192_state *st = iio_priv(indio_dev); + + return st->syscalib_mode[chan->channel]; +} + +static ssize_t ad7192_write_syscalib(struct iio_dev *indio_dev, + uintptr_t private, + const struct iio_chan_spec *chan, + const char *buf, size_t len) +{ + struct ad7192_state *st = iio_priv(indio_dev); + bool sys_calib; + int ret, temp; + + ret = strtobool(buf, &sys_calib); + if (ret) + return ret; + + temp = st->syscalib_mode[chan->channel]; + if (sys_calib) { + if (temp == AD7192_SYSCALIB_ZERO_SCALE) + ret = ad_sd_calibrate(&st->sd, AD7192_MODE_CAL_SYS_ZERO, + chan->address); + else + ret = ad_sd_calibrate(&st->sd, AD7192_MODE_CAL_SYS_FULL, + chan->address); + } + + return ret ? ret : len; +} + +static const struct iio_enum ad7192_syscalib_mode_enum = { + .items = ad7192_syscalib_modes, + .num_items = ARRAY_SIZE(ad7192_syscalib_modes), + .set = ad7192_set_syscalib_mode, + .get = ad7192_get_syscalib_mode +}; + +static const struct iio_chan_spec_ext_info ad7192_calibsys_ext_info[] = { + { + .name = "sys_calibration", + .write = ad7192_write_syscalib, + .shared = IIO_SEPARATE, + }, + IIO_ENUM("sys_calibration_mode", IIO_SEPARATE, + &ad7192_syscalib_mode_enum), + IIO_ENUM_AVAILABLE("sys_calibration_mode", &ad7192_syscalib_mode_enum), + {} +}; + static struct ad7192_state *ad_sigma_delta_to_ad7192(struct ad_sigma_delta *sd) { return container_of(sd, struct ad7192_state, sd); @@ -769,9 +844,11 @@ static int ad7192_channels_config(struct iio_dev *indio_dev) *chan = channels[i]; chan->info_mask_shared_by_all |= BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY); - if (chan->type != IIO_TEMP) + if (chan->type != IIO_TEMP) { chan->info_mask_shared_by_type_available |= BIT(IIO_CHAN_INFO_SCALE); + chan->ext_info = ad7192_calibsys_ext_info; + } chan++; } From patchwork Mon Sep 2 13:08:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mircea Caprioru X-Patchwork-Id: 11126709 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0C291398 for ; Mon, 2 Sep 2019 13:09:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9162221881 for ; Mon, 2 Sep 2019 13:09:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=analog.onmicrosoft.com header.i=@analog.onmicrosoft.com header.b="wQFrBEcW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730616AbfIBNJ1 (ORCPT ); Mon, 2 Sep 2019 09:09:27 -0400 Received: from mx0b-00128a01.pphosted.com ([148.163.139.77]:10062 "EHLO mx0b-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729840AbfIBNJ1 (ORCPT ); Mon, 2 Sep 2019 09:09:27 -0400 Received: from pps.filterd (m0167091.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x82D95BX014151; Mon, 2 Sep 2019 09:09:05 -0400 Received: from nam01-sn1-obe.outbound.protection.outlook.com (mail-sn1nam01lp2056.outbound.protection.outlook.com [104.47.32.56]) by mx0b-00128a01.pphosted.com with ESMTP id 2uqjna3e9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Sep 2019 09:09:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WlOeYkGw8qGGzxE+m+cxDE6MIZ6bxoB4u2iLioRui7D5hs7eWgqIhpZ0y8HnKPu394og7AcSQUPfJyIvEgF2wxOwFFeBO7/rzJS+Hrp+BdAuQlrDsvZgyjzgQAlvPye3k7MwqKyZb6mlUTK8BVBNEYBTKpEunPyNj5AtCUBbl6T2xf4M5JQH1FBdJsmZiZ7qzdjobe9Ij6tfI0W/3MRYl3y11qgzl7AXsx7nHIBkmxHs5lElIENYFbI+E1I7o+a1wnLc4AmLLkiT7k3ZVlxMqWJIQXBwEg+8Pi12YCeU+dgDd9rMpqYRsDx7Ad2m3aLLomfh6H88jclxjezPlvK1Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pssop/eUyJ4/GGFH8lTOLGrZ1Ix9kuq0rKb3TIW/nrA=; b=jNu2zmLKgCfoqk+IH4TTDsxSzAgfL7oSNSwXwfFn0iUZM6CixPJF2I1xyObh0F3nU8PQR2L5186zYJEW3srfS1n7Pn09iPnSarIMIBxFiAoEQ2vsLRRFgo5K2fFtl8IJPD36FOMgGQ0B81nTyHEyUuZkF4A8G+SvxUglGGIK5v47+XskxxaTyV+BkD19pueAjIxnG83FbnJ98008tO6exz6GSPmowNtlsR1/ixciM2SKb7vJe7GClZ3xHuS8BnhNSMw5PT19TEisPAFvk8DJQycMZf7AUOMmNEazIGYGM81ienz0fGFp9RizuIqFkVFKdeAKu1fKYBEs/wudw1wlAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 137.71.25.57) smtp.rcpttodomain=metafoo.de smtp.mailfrom=analog.com; dmarc=bestguesspass action=none header.from=analog.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector2-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pssop/eUyJ4/GGFH8lTOLGrZ1Ix9kuq0rKb3TIW/nrA=; b=wQFrBEcWwM1I25DBylsp2lG5LfkrVyXXvX7dHsFb6R1VYHMMYqcW1ic7PY0kaC0RVH6ZW34XPJoQjUdQYBy3DRCbKiMFBeqqLgranYRmWlBbxbwbC5SliAdwyofTv5KuHs91cqC9KYx81fBN3Jhoex8MaBS0haFn+EyS+XdzJWs= Received: from BN6PR03CA0115.namprd03.prod.outlook.com (2603:10b6:404:10::29) by BN8PR03MB5044.namprd03.prod.outlook.com (2603:10b6:408:d8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.20; Mon, 2 Sep 2019 13:08:46 +0000 Received: from BL2NAM02FT059.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::209) by BN6PR03CA0115.outlook.office365.com (2603:10b6:404:10::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2220.19 via Frontend Transport; Mon, 2 Sep 2019 13:08:45 +0000 Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta2.analog.com; Received: from nwd2mta2.analog.com (137.71.25.57) by BL2NAM02FT059.mail.protection.outlook.com (10.152.76.247) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2220.16 via Frontend Transport; Mon, 2 Sep 2019 13:08:45 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id x82D8j1j027178 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 2 Sep 2019 06:08:45 -0700 Received: from mircea-Latitude-E6540.ad.analog.com (10.48.65.107) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Mon, 2 Sep 2019 09:08:44 -0400 From: Mircea Caprioru To: CC: , , , , , , , , Mircea Caprioru Subject: [PATCH V4 4/4] dt-bindings: iio: adc: ad7192: Add binding documentation for AD7192 Date: Mon, 2 Sep 2019 16:08:31 +0300 Message-ID: <20190902130831.23057-4-mircea.caprioru@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190902130831.23057-1-mircea.caprioru@analog.com> References: <20190902130831.23057-1-mircea.caprioru@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(979002)(136003)(396003)(346002)(376002)(39860400002)(2980300002)(54534003)(189003)(199004)(50466002)(6666004)(356004)(486006)(126002)(44832011)(476003)(446003)(2616005)(11346002)(5660300002)(86362001)(70206006)(7636002)(70586007)(426003)(54906003)(50226002)(106002)(316002)(47776003)(14444005)(2351001)(8676002)(1076003)(4326008)(8936002)(246002)(2870700001)(36756003)(478600001)(2906002)(6916009)(53376002)(107886003)(26005)(76176011)(7696005)(186003)(336012)(305945005)(966005)(6306002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN8PR03MB5044;H:nwd2mta2.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 59aaadfc-dc46-4c4a-8ca7-08d72fa6afcc X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(4709080)(1401327)(4618075)(2017052603328);SRVR:BN8PR03MB5044; X-MS-TrafficTypeDiagnostic: BN8PR03MB5044: X-MS-Exchange-PUrlCount: 3 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 01480965DA X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: wbHXN7VHo+uLFWNAIapWoZpQz9ozpaqpmX3hHF0wrWBDR+IZsDX5JKnggIqVER357/KZ4JntZUzmDgTQJ/zBwPu+Hql+zAg7E5gkaE9cHiJoNxGkcdpsbz5NN2vvzcivBqsHG+c+iYrs2PIjI7FEg3iZ8YhcCLtGdLNQlUosMFtS2sgcn+H1Tf63aDOjJGzDJb+x1/seAxZ7WnkF204VvTOVE7m3/YNYtJjAdoRQSm8gUkaVaMNpt4FWAUH2rp3XIqg6VQbsx+Z7g8vefKgUDdeHW+iAv6NQyzC5X2cHAZn1wObMCQxS5jp62lT0DEsUgt1EQkLSibxBqo2a+fIVns4pgSMfGhhVXBbeC1XbtfbgP5OPWijBcjlJromu6G60cuELZuXjR8DOyw2drGwVaAmyJkmXgjuB2z5ekXyvUwA= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2019 13:08:45.5718 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 59aaadfc-dc46-4c4a-8ca7-08d72fa6afcc X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB5044 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-02_05:2019-08-29,2019-09-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 clxscore=1015 mlxlogscore=999 priorityscore=1501 suspectscore=0 mlxscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1909020148 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org This patch add device tree binding documentation for AD7192 adc in YAML format. Signed-off-by: Mircea Caprioru Reviewed-by: Rob Herring --- Changelog V2: - no changes here Changelog V3: - no changes here Changelog V4: - remove the const value from avdd and dvdd supply .../bindings/iio/adc/adi,ad7192.yaml | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml new file mode 100644 index 000000000000..040af0bcc92e --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml @@ -0,0 +1,119 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 Analog Devices Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bindings/iio/adc/adi,ad7192.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices AD7192 ADC device driver + +maintainers: + - Michael Hennerich + +description: | + Bindings for the Analog Devices AD7192 ADC device. Datasheet can be + found here: + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7192.pdf + +properties: + compatible: + enum: + - adi,ad7190 + - adi,ad7192 + - adi,ad7193 + - adi,ad7195 + + reg: + maxItems: 1 + + spi-cpol: true + + spi-cpha: true + + clocks: + maxItems: 1 + description: phandle to the master clock (mclk) + + clock-names: + items: + - const: mclk + + interrupts: + maxItems: 1 + + dvdd-supply: + description: DVdd voltage supply + maxItems: 1 + + avdd-supply: + description: AVdd voltage supply + maxItems: 1 + + adi,rejection-60-Hz-enable: + description: | + This bit enables a notch at 60 Hz when the first notch of the sinc + filter is at 50 Hz. When REJ60 is set, a filter notch is placed at + 60 Hz when the sinc filter first notch is at 50 Hz. This allows + simultaneous 50 Hz/ 60 Hz rejection. + type: boolean + + adi,refin2-pins-enable: + description: | + External reference applied between the P1/REFIN2(+) and P0/REFIN2(−) pins. + type: boolean + + adi,buffer-enable: + description: | + Enables the buffer on the analog inputs. If cleared, the analog inputs + are unbuffered, lowering the power consumption of the device. If this + bit is set, the analog inputs are buffered, allowing the user to place + source impedances on the front end without contributing gain errors to + the system. + type: boolean + + adi,burnout-currents-enable: + description: | + When this bit is set to 1, the 500 nA current sources in the signal + path are enabled. When BURN = 0, the burnout currents are disabled. + The burnout currents can be enabled only when the buffer is active + and when chop is disabled. + type: boolean + + bipolar: + description: see Documentation/devicetree/bindings/iio/adc/adc.txt + type: boolean + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - dvdd-supply + - avdd-supply + - spi-cpol + - spi-cpha + +examples: + - | + spi0 { + adc@0 { + compatible = "adi,ad7192"; + reg = <0>; + spi-max-frequency = <1000000>; + spi-cpol; + spi-cpha; + clocks = <&ad7192_mclk>; + clock-names = "mclk"; + #interrupt-cells = <2>; + interrupts = <25 0x2>; + interrupt-parent = <&gpio>; + dvdd-supply = <&dvdd>; + avdd-supply = <&avdd>; + + adi,refin2-pins-enable; + adi,rejection-60-Hz-enable; + adi,buffer-enable; + adi,burnout-currents-enable; + }; + };