Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2471476ima; Mon, 22 Oct 2018 10:16:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV62smZHFeuZvP19sz/42fphE4BzgoKqbgcYNw8nVMmuuxomfYjSeDunpSrdfez+Lm6pzQeur X-Received: by 2002:a65:664e:: with SMTP id z14-v6mr42150971pgv.347.1540228566149; Mon, 22 Oct 2018 10:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540228566; cv=none; d=google.com; s=arc-20160816; b=O5ZfEleKWNrfOJe6Z8tGyrb3dChcn1PAhFutiOtp1FFbNNfyUUxDECfqbZtr0PCxkg lHq8FgRbGoSNmw+KdDlkAGuHU2SO1k9WWd63KAlQB08FX/goagslmt6B9xDKFGDhbce2 7v94fTkQw8/wstDOMR9hvSPBurtq+v+YrYUMUJU7XFlyxvIfpK7ah8fFw/OrjKgCq27p TLys93+tb+ypN+TVxUzBw+BNSChPL6oxkVXjvXgLzxmqKGa7s9LJKRAi1pcD8UPiaF0E SVyKUz4c0A4+oYsRtFDKELTdx9jSCg3/5Z5qKIp3nB2GGsTyBu1/sglcZPuSjkJpdsog zk8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=pLkG0HIJAj3KbkgNecEmQgtRzJFgvSmpnolcOr7zFiI=; b=EUNlOOrtEsmy7wOFV/AQRamWbAb+sUqDSRcbyJ4yxFqMJJuW3+xZ+MgNVWn1uqIQDR OfmGizYo5/6BYWXYraw06jBl/Ii2ZWKLqXnGTocXKEZVCd8KogjsEdExZSZcDeF3rcnJ 94M+X93LBLqTFO24RpLtst5U1hXaMByXd7XTNRrEALe93wO79et0c1xhgfygsePNbKy0 8CsfMrVhD33nwaHuhEDj6wHTp+wBzH9LjpDogc2w15Pz8KMJYFDUbXlnyqajn6iLZB0c CQqfvZST72nvL+qxiEtA08Oyj/pfqhglBsu5HrhiU88izs5LwSrehw6q/jiyJLfW3jEe UJzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iO4R4Rnl; 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 e8-v6si6601792pgd.113.2018.10.22.10.15.50; Mon, 22 Oct 2018 10:16:06 -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=iO4R4Rnl; 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 S1728717AbeJWBdw (ORCPT + 99 others); Mon, 22 Oct 2018 21:33:52 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43521 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727218AbeJWBdw (ORCPT ); Mon, 22 Oct 2018 21:33:52 -0400 Received: by mail-pl1-f196.google.com with SMTP id 30-v6so19357401plb.10; Mon, 22 Oct 2018 10:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=pLkG0HIJAj3KbkgNecEmQgtRzJFgvSmpnolcOr7zFiI=; b=iO4R4RnlkkxDD77YduynsJqYajuMAClgoloX4Z+Mes2a+F/C1EUSxLd9D1iquLMUCi 3J9h3vs9uMil4F6kfuIaQfB0wPvth+eSi8rXmk0NwpxmZx0Fe4bnV4w+stIZfyaAD7eT cYqHBWkgtOd04Mhc7PgPrBLVA4hk8KHla+QVzIf4hvZ4tbIdHzn9IW0k9AD1WrdUrhaG PTaqNOw0mQnp350ksx7gbBh4m02SQ7SbYXgcT4pumQLlI6Ycasnu8wZmU056PIl49KHk q/WyI3k3w8Ku3uKGHfoqrJJbR2rba6k52fotQJIi72BUe6iGzVvrRB8ZJ5xCnzvBY1NA LsfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=pLkG0HIJAj3KbkgNecEmQgtRzJFgvSmpnolcOr7zFiI=; b=TeLnnCxUzGAr/XKMsoinfWEb2qx7s+wHRywFr6/OGMDzsNI74yUY+UjGL7+1tyjZi1 F2msuhQbDNGKl50p9OHWlGyTeyciWaRv/7nVv/n+bOJpx4uleCQrgofW+o/Q2m9KuQC4 Gk28NE4rPmD8vXt9e0QnfaqIZl5hPGME+2r9nkcx2wd1yBZ9PPnmxn40L+/YC6875fOs h5N6y39O3fjqNIbI9HDSgg8qW7/v74ZPrvRDg9VlMUm5zStvY7fmQ6XCFUpLiX8/SmaO hZGai0ANjYJ1quMZbqGzQtRP/hGvyv7f+v03GTAKyrvMtgtWSTCsv4MXuW5nHkk+WG9D 24Rg== X-Gm-Message-State: ABuFfojcM+Jwd1x4ISVfEX5OQaLfZrD2rrDjTjyBuUbHwKhu1+1SwD7V U3AGuPjPTvi5YYN91Ay/G9g= X-Received: by 2002:a17:902:5a89:: with SMTP id r9-v6mr44745607pli.95.1540228470313; Mon, 22 Oct 2018 10:14:30 -0700 (PDT) Received: from nishad ([106.51.27.228]) by smtp.gmail.com with ESMTPSA id a16-v6sm7973812pgb.6.2018.10.22.10.14.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Oct 2018 10:14:29 -0700 (PDT) Date: Mon, 22 Oct 2018 22:44:22 +0530 From: Nishad Kamdar To: Lars-Peter Clausen Cc: Slawomir Stepien , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: iio: adt7316: Switch to the gpio descriptor interface Message-ID: <20181022171418.GA2612@nishad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the gpiod interface instead of the deprecated old non-descriptor interface for ldac_pin. Signed-off-by: Nishad Kamdar --- drivers/staging/iio/addac/adt7316.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c index 3f22d1088713..94f945ba0097 100644 --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include #include @@ -177,7 +177,7 @@ struct adt7316_chip_info { struct adt7316_bus bus; - u16 ldac_pin; + struct gpio_desc *ldac_pin; u16 int_mask; /* 0x2f */ u8 config1; u8 config2; @@ -950,8 +950,8 @@ static ssize_t adt7316_store_update_DAC(struct device *dev, if (ret) return -EIO; } else { - gpio_set_value(chip->ldac_pin, 0); - gpio_set_value(chip->ldac_pin, 1); + gpiod_set_value(chip->ldac_pin, 0); + gpiod_set_value(chip->ldac_pin, 1); } return len; @@ -2120,7 +2120,14 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, else return -ENODEV; - chip->ldac_pin = adt7316_platform_data[1]; + chip->ldac_pin = devm_gpiod_get(dev, "ldac", GPIOD_OUT_HIGH); + if (IS_ERR(chip->ldac_pin)) { + ret = PTR_ERR(chip->ldac_pin); + dev_err(dev, "Failed to request ldac GPIO: %d\n", + ret); + return ret; + } + if (chip->ldac_pin) { chip->config3 |= ADT7316_DA_EN_VIA_DAC_LDCA; if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX) -- 2.17.1