Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3833465ybh; Tue, 17 Mar 2020 07:26:22 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvDRdwOeKBsA5hwdFoM4LDBt3i6eP7ScQElb9riFGzdzGdW1NDSSB+9v9meXEtV+efuLol1 X-Received: by 2002:a05:6830:109:: with SMTP id i9mr4168592otp.4.1584455182454; Tue, 17 Mar 2020 07:26:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1584455182; cv=pass; d=google.com; s=arc-20160816; b=zlWbgyjddAQG5OdJqgtpv6hm7XXrGT9KByYoaUxJjRz9CGgt0DYICyPoulWpzIU+MF pgtsEbm8zZ7lTwgyrs0XRIF1ntWsE0I92TAZKJ6OL8lxEPm50Zcg+mXzpMn4tUIi9xaN orJSYWbVR07t1jxSkwWzWNXjtWDg6DXwPgvxopsb8NN9PXbVpu3P/wnSdBqqPcmZF/4e olgwIsVb5nl7sZKvCwzjfC8kIQ3X2tRcYRKm/xgGK0QDfEQE2GETE8vwz6yYIp9hKzA+ RVhx79Mgd+muCjCPkRv8hacSM8afu8NPAApezCN8e3B35MvoJMoto932xqC6/c/Kkib3 hkdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=8l5aLNEki9ZFpEdtjpTUKTOppPhOtJdsdsNw0WOwhoM=; b=KPwYuT0QYQzLNRrw7+c+0IULbbFxhTqrf1oBg2/BXXTeoHn6lUpwZl7nUc+Ptf5eyl +Tq/cWBmT6JMmSv8aATDq8lWSKu2fKOED8DCT+dmaAuyeYiUNP7MwKWA180ctiaVUxsF djajN1zp3g+zD0Zx3ESsHBt3YT1VrSSdwtiiNcWEEmWnvelL9l8DP3jexz3p4JZb9Z78 lJsrTYn7b2JPNkfZ57tlj4DigCjGtBedRtC+ls72v25h/dnIr9MOMbOWwGYChCGuDbxw m7XZMagofem2f87UHeln1YtOXx2ohTcgDnt9KGF//9ZziwHbfy99EkuYbklbeFJVIImH s+Rw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nio365.onmicrosoft.com header.s=selector2-nio365-onmicrosoft-com header.b=MLWJ9SsH; arc=pass (i=1 spf=pass spfdomain=ni.com dkim=pass dkdomain=ni.com dmarc=pass fromdomain=ni.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=ni.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si1698495otr.193.2020.03.17.07.26.10; Tue, 17 Mar 2020 07:26:22 -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=@nio365.onmicrosoft.com header.s=selector2-nio365-onmicrosoft-com header.b=MLWJ9SsH; arc=pass (i=1 spf=pass spfdomain=ni.com dkim=pass dkdomain=ni.com dmarc=pass fromdomain=ni.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=ni.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbgCQOZ1 (ORCPT + 99 others); Tue, 17 Mar 2020 10:25:27 -0400 Received: from mx0b-00010702.pphosted.com ([148.163.158.57]:10754 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbgCQOZ0 (ORCPT ); Tue, 17 Mar 2020 10:25:26 -0400 X-Greylist: delayed 1686 seconds by postgrey-1.27 at vger.kernel.org; Tue, 17 Mar 2020 10:25:25 EDT Received: from pps.filterd (m0098778.ppops.net [127.0.0.1]) by mx0b-00010702.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02HDdYPd016250; Tue, 17 Mar 2020 08:57:00 -0500 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2175.outbound.protection.outlook.com [104.47.57.175]) by mx0b-00010702.pphosted.com with ESMTP id 2yrv7yrgt9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Mar 2020 08:57:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GPiMz+yzhOzapvCK1oFAoonSIG3EF+gWkOUva9gsoQX0JNxMrqq+0vgIoCcQ7qZU6Gv9tsvihsmi3HlWuWdEkt5qrpgm2VivlmMU5BIkA0rszDAiiFyo92wDBcIh3aO8hLumQVHmhLoJYL5nPWgR/wSO+c+he7Jv3dzmtEce+v3fqGqy1UdHO2MfoDPhH5KZe5fL7BKOChHSpvPuVpX07t2xkr8JJziYhcPXc6U7l6XNUDWR5ZAluvXaGhfB9K6zW1yAVrptndQz5vrEfqpP/An7ClkeYbyid6uWW8t0R+oEVluxoO6rBdaIHPlx5/gEbVixvgwrJSpkv9pSnQ0D9Q== 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=8l5aLNEki9ZFpEdtjpTUKTOppPhOtJdsdsNw0WOwhoM=; b=KuUiUgQIgHqCCSPaovOUM3CLIm3KK7Weq8N3NHc4HMGxNZvG3RNvxnKllF/ELOA9h2jUvwzOL8nuPSugeaD0ACqqObpBPKvlxmck+6NDifrWwKYWRebIQMxVQF4c8DRVrngbdLiwR/CVMLqPjjb4GEnU0iWt8aYN73XZ+Yl8Xt4ZnHdNBWjbcalsjT4VFubW4MRGsHqLvKKnYccU/H8gtfeq2aNZciYOkPW0ZbChLzXbhMoZ2QPjNvVhnbGeJsTJL1EAYcL18sx8uL/lXucqpWsX3wr18huV4pG6AfXx74vOyG4CjkPZ1Pp20+qmwY/hL8B/+OvAVAIVkaYbxarnBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ni.com; dmarc=pass action=none header.from=ni.com; dkim=pass header.d=ni.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nio365.onmicrosoft.com; s=selector2-nio365-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8l5aLNEki9ZFpEdtjpTUKTOppPhOtJdsdsNw0WOwhoM=; b=MLWJ9SsHva+R5fYrEkUl3PFeRBazKLyepjmuczT26ugytIPSnQwmiMpIAEvZbI/0yR8eU1QScHR8fedbTHZkI7QvzkiC8eVGmINSDPdU7kXrnMKVrJDq6Bd20Hcp06jugo1Zsor6eFrn4/XbhGfvc6hPH2dPhl68qnD8DRiejuw= Received: from SN4PR0401MB3646.namprd04.prod.outlook.com (2603:10b6:803:4b::29) by SN4PR0401MB3567.namprd04.prod.outlook.com (2603:10b6:803:4b::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Tue, 17 Mar 2020 13:56:59 +0000 Received: from SN4PR0401MB3646.namprd04.prod.outlook.com ([fe80::d05b:1953:4111:38e4]) by SN4PR0401MB3646.namprd04.prod.outlook.com ([fe80::d05b:1953:4111:38e4%5]) with mapi id 15.20.2793.023; Tue, 17 Mar 2020 13:56:59 +0000 From: Michael Auchter To: Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Liam Girdwood , Mark Brown Cc: Michael Auchter , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Subject: [PATCH 1/2] iio: adc: ad7291: convert to device tree Date: Tue, 17 Mar 2020 08:56:48 -0500 Message-Id: <20200317135649.8876-1-michael.auchter@ni.com> X-Mailer: git-send-email 2.24.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN4PR0401CA0034.namprd04.prod.outlook.com (2603:10b6:803:2a::20) To SN4PR0401MB3646.namprd04.prod.outlook.com (2603:10b6:803:4b::29) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xaphan.phire.org (66.90.216.181) by SN4PR0401CA0034.namprd04.prod.outlook.com (2603:10b6:803:2a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18 via Frontend Transport; Tue, 17 Mar 2020 13:56:58 +0000 X-Mailer: git-send-email 2.24.1 X-Originating-IP: [66.90.216.181] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 84482265-6754-4f5e-e173-08d7ca7b0f97 X-MS-TrafficTypeDiagnostic: SN4PR0401MB3567:|SN4PR0401MB3567: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-Forefront-PRVS: 0345CFD558 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4636009)(376002)(39860400002)(366004)(346002)(136003)(396003)(199004)(6666004)(110136005)(2906002)(6512007)(186003)(66476007)(2616005)(956004)(44832011)(6506007)(5660300002)(478600001)(52116002)(4326008)(316002)(26005)(1076003)(7416002)(16526019)(66556008)(36756003)(81156014)(81166006)(8936002)(8676002)(6486002)(66946007)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:SN4PR0401MB3567;H:SN4PR0401MB3646.namprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1; Received-SPF: None (protection.outlook.com: ni.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GSKTuYIKTc1hCSGi6W8AeONFf3CqUn+1O3geajmsxiuVLnUOJP7Y/qLPWiIpbOje4kD0EgXMEfPWr7waPgpIka+ETGE9LGKzrekP617U/lrDw+qL0n1mv+DxTTdRzaTKmU2/55wqfBJM9Il3gH35CSePA1Ghs7Gvo0xvHwmF8nrmDZm3Ay4TQ1V4ET6KCmNB7knWNLXoUugFv4OmbVJ/smaMPMiN9l2zzZr4U05FlzgOaVCX5zCCFOTZIuMN9/NohznNBecKKOEPPxJis2I2nx+jQfaf/iUU26r7JcKJmT9VD8IMNSdEfBXzYxgvddOPnxuO55mNK2JeyubT0XewmrxnEEekBJAAh9Vlso4aiwclg5bQy7gSvfEH/lDCWxQdf8e8EfH338JjXAPW7Cu3ZsicPz8JPpXsWbvSjIEOP6pfArSawL8T3IMbQpxlTlUe X-MS-Exchange-AntiSpam-MessageData: vH4EHDiME/INafscMrRJ1+7fw4DjPdKEoe1lFRh4Tc1QBHMsyvhzt6VQopewRT2rh4rElYbXAD979QtUe8KNgPBQ7vvx4DpOqeJ6LrzGLJ2cEmpBWCUp0urihReN7iNOA4gam1zaU/YRkiGlCSerYg== X-OriginatorOrg: ni.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84482265-6754-4f5e-e173-08d7ca7b0f97 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2020 13:56:59.0153 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 87ba1f9a-44cd-43a6-b008-6fdb45a5204e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Z6//nGCv0zCSVpwcTp5lXz64AyRy8JNOQZYZIbymZ9iLw16AKmPU/QC1Spx1KvD1S6A2AXwx2jnI9fp/gfc/Fw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0401MB3567 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.645 definitions=2020-03-17_05:2020-03-17,2020-03-17 signatures=0 X-Proofpoint-Spam-Details: rule=inbound_policy_notspam policy=inbound_policy score=30 mlxscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 clxscore=1011 adultscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003170060 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are no in-tree users of the platform data for this driver, so remove it and convert the driver to use device tree instead. Signed-off-by: Michael Auchter --- drivers/iio/adc/ad7291.c | 33 ++++++++++++++++------------ include/linux/platform_data/ad7291.h | 13 ----------- 2 files changed, 19 insertions(+), 27 deletions(-) delete mode 100644 include/linux/platform_data/ad7291.h diff --git a/drivers/iio/adc/ad7291.c b/drivers/iio/adc/ad7291.c index b2b137fed246..536e31862309 100644 --- a/drivers/iio/adc/ad7291.c +++ b/drivers/iio/adc/ad7291.c @@ -20,8 +20,6 @@ #include #include -#include - /* * Simplified handling * @@ -465,7 +463,6 @@ static const struct iio_info ad7291_info = { static int ad7291_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct ad7291_platform_data *pdata = client->dev.platform_data; struct ad7291_chip_info *chip; struct iio_dev *indio_dev; int ret; @@ -475,16 +472,6 @@ static int ad7291_probe(struct i2c_client *client, return -ENOMEM; chip = iio_priv(indio_dev); - if (pdata && pdata->use_external_ref) { - chip->reg = devm_regulator_get(&client->dev, "vref"); - if (IS_ERR(chip->reg)) - return PTR_ERR(chip->reg); - - ret = regulator_enable(chip->reg); - if (ret) - return ret; - } - mutex_init(&chip->state_lock); /* this is only used for device removal purposes */ i2c_set_clientdata(client, indio_dev); @@ -495,8 +482,19 @@ static int ad7291_probe(struct i2c_client *client, AD7291_T_SENSE_MASK | /* Tsense always enabled */ AD7291_ALERT_POLARITY; /* set irq polarity low level */ - if (pdata && pdata->use_external_ref) + chip->reg = devm_regulator_get_optional(&client->dev, "vref"); + if (IS_ERR(chip->reg)) { + if (PTR_ERR(chip->reg) == -EPROBE_DEFER) + return -EPROBE_DEFER; + + chip->reg = NULL; + } else { + ret = regulator_enable(chip->reg); + if (ret) + return ret; + chip->command |= AD7291_EXT_REF; + } indio_dev->name = id->name; indio_dev->channels = ad7291_channels; @@ -569,9 +567,16 @@ static const struct i2c_device_id ad7291_id[] = { MODULE_DEVICE_TABLE(i2c, ad7291_id); +static const struct of_device_id ad7291_of_match[] = { + { .compatible = "adi,ad7291", }, + {}, +}; +MODULE_DEVICE_TABLE(of, ad7291_of_match); + static struct i2c_driver ad7291_driver = { .driver = { .name = KBUILD_MODNAME, + .of_match_table = of_match_ptr(ad7291_of_match), }, .probe = ad7291_probe, .remove = ad7291_remove, diff --git a/include/linux/platform_data/ad7291.h b/include/linux/platform_data/ad7291.h deleted file mode 100644 index b1fd1530c9a5..000000000000 --- a/include/linux/platform_data/ad7291.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __IIO_AD7291_H__ -#define __IIO_AD7291_H__ - -/** - * struct ad7291_platform_data - AD7291 platform data - * @use_external_ref: Whether to use an external or internal reference voltage - */ -struct ad7291_platform_data { - bool use_external_ref; -}; - -#endif -- 2.24.1