From patchwork Sun Nov 25 11:25:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishad Kamdar X-Patchwork-Id: 10696775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E18A15A4 for ; Sun, 25 Nov 2018 11:25:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C97672921E for ; Sun, 25 Nov 2018 11:25:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B99082929C; Sun, 25 Nov 2018 11:25:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 593CA2921E for ; Sun, 25 Nov 2018 11:25:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726023AbeKYWQ3 (ORCPT ); Sun, 25 Nov 2018 17:16:29 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37359 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbeKYWQ3 (ORCPT ); Sun, 25 Nov 2018 17:16:29 -0500 Received: by mail-pf1-f196.google.com with SMTP id u3-v6so5208189pfm.4; Sun, 25 Nov 2018 03:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Vw76Tev+d0mqnbRLVVripM3+SmfgYdN9yEyQ2gFNZSg=; b=Mgxc/bif2iMpH9x7I5xfQGAH7c8/q+rWZfMs7PWrHDNYcZRgxtXGHsOI+kiy0lU77B Hc/63MFFHntqI6zXnQwSeXyvdypGFqRYl2IjHVqKo1jNx6aovPkgUJSYlyTEcpCWzwMD 4LIXKaA9gwDa2968FCzDZkwcprMijDdQmLilDrlbFEFh0yjKCD9a5qzyOcpcvFnr7B5r SNI/GT4X0j8PtXy1JqJulrOjJJs11GPMZVBVUz1UFMwK/2hY5PZU3xmvnzfueY7RyQvd b9ysypwHA1KEjyQ1GnNeusEo3/5po++GQYHWFXtkB/rjWpnVMnngZHQf+du8BI09+1U+ e+8A== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Vw76Tev+d0mqnbRLVVripM3+SmfgYdN9yEyQ2gFNZSg=; b=IV4qLWW7IFuXg+2AQen7kZoPKSHW0jOJpLYKbiN8rWl1mKEeM7Dv9PYEMMZO8T96Nc gKaWuL36Ppd7/PfbUX3EoUdfbMakWehYC9hLAF0OYlTLOM/YiMVqyY+myn9qrLu2mi3w GRRPnTcDVC5hxOnO8dId4JKs+ikgAaVATpf4v5tqlC9Af8Xcjw50g2fF8heF6g8WnTJc jh4Knw3FCivYbvmKtRVDWweGYXimRcahjq7aXqtCRMrf7HdhV6g2XWvLrgUlI4va0a6c iEbNEu8817OK9WKh5N49Y0FrPFZdDTcTylKSZIr1sHoKiFIX5kodfN1AfAqPMOn7qu75 OyPg== X-Gm-Message-State: AGRZ1gK8cBgQOsjH4nLHEjtaPPvxrROetwvv1sBdoZZyUgbsdUsKav16 XQD6J4+6aVtRnBsPBjQUTQ/crNzrQsJ/Nw== X-Google-Smtp-Source: AJdET5eTVdfftlcKCDsl6eGFSekaotlMJBl3ryr4pt5VmH1HZ8Z2DnbwMRZVD5SJn5iIQFXJUooq1g== X-Received: by 2002:a62:5793:: with SMTP id i19mr23483005pfj.49.1543145137702; Sun, 25 Nov 2018 03:25:37 -0800 (PST) Received: from nishad ([106.51.27.228]) by smtp.gmail.com with ESMTPSA id g65sm208659285pfa.63.2018.11.25.03.25.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Nov 2018 03:25:37 -0800 (PST) Date: Sun, 25 Nov 2018 16:55:31 +0530 From: Nishad Kamdar To: Greg Kroah-Hartman Cc: Thomas Petazzoni , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH 03/26] Staging: fbtft: fbtft-io: Switch to the gpio descriptor interface Message-ID: <7f743e900391226084fc4f29a2a73e0231b6fe55.1543142440.git.nishadkamdar@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This switches the fbtft-io to use GPIO descriptors rather than numerical gpios. Signed-off-by: Nishad Kamdar --- drivers/staging/fbtft/fbtft-io.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c index b5051d3d46a6..38cdad6203ea 100644 --- a/drivers/staging/fbtft/fbtft-io.c +++ b/drivers/staging/fbtft/fbtft-io.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include -#include +#include #include #include "fbtft.h" @@ -142,30 +142,30 @@ int fbtft_write_gpio8_wr(struct fbtft_par *par, void *buf, size_t len) data = *(u8 *)buf; /* Start writing by pulling down /WR */ - gpio_set_value(par->gpio.wr, 0); + gpiod_set_value(par->gpio.wr, 0); /* Set data */ #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO if (data == prev_data) { - gpio_set_value(par->gpio.wr, 0); /* used as delay */ + gpiod_set_value(par->gpio.wr, 0); /* used as delay */ } else { for (i = 0; i < 8; i++) { if ((data & 1) != (prev_data & 1)) - gpio_set_value(par->gpio.db[i], - data & 1); + gpiod_set_value(par->gpio.db[i], + data & 1); data >>= 1; prev_data >>= 1; } } #else for (i = 0; i < 8; i++) { - gpio_set_value(par->gpio.db[i], data & 1); + gpiod_set_value(par->gpio.db[i], data & 1); data >>= 1; } #endif /* Pullup /WR */ - gpio_set_value(par->gpio.wr, 1); + gpiod_set_value(par->gpio.wr, 1); #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO prev_data = *(u8 *)buf; @@ -192,30 +192,30 @@ int fbtft_write_gpio16_wr(struct fbtft_par *par, void *buf, size_t len) data = *(u16 *)buf; /* Start writing by pulling down /WR */ - gpio_set_value(par->gpio.wr, 0); + gpiod_set_value(par->gpio.wr, 0); /* Set data */ #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO if (data == prev_data) { - gpio_set_value(par->gpio.wr, 0); /* used as delay */ + gpiod_set_value(par->gpio.wr, 0); /* used as delay */ } else { for (i = 0; i < 16; i++) { if ((data & 1) != (prev_data & 1)) - gpio_set_value(par->gpio.db[i], - data & 1); + gpiod_set_value(par->gpio.db[i], + data & 1); data >>= 1; prev_data >>= 1; } } #else for (i = 0; i < 16; i++) { - gpio_set_value(par->gpio.db[i], data & 1); + gpiod_set_value(par->gpio.db[i], data & 1); data >>= 1; } #endif /* Pullup /WR */ - gpio_set_value(par->gpio.wr, 1); + gpiod_set_value(par->gpio.wr, 1); #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO prev_data = *(u16 *)buf;