Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp919524pxb; Thu, 28 Jan 2021 03:46:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/ovx8gSmC2i0NTdEbSez0FF9MuLPPABKPeeDZuCNoPxqonAmb3IeI/ZCT2Ya6xoqZHixU X-Received: by 2002:a17:907:abc:: with SMTP id bz28mr10558216ejc.395.1611834408759; Thu, 28 Jan 2021 03:46:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611834408; cv=none; d=google.com; s=arc-20160816; b=v8QHYVEIeRecKLr7Tmq1CaaMBi876eXQpFN25OEV1D4VNn5XtUowr+khl6/7IyomGa 6PhZmci+66oa4GjvDZoFBmHle04rA/0IC/KHZXauAP4m23FqNt1hEfS6aoY16mbt8z8H sDA9BxXSh7C5oGSC1mIg8AKoAmj7UDwsUuWARdfAJcXccK417t+DHu1QCRmkLjs7oQ5G GZym5vg+uhXp/KqLk9ru/NrTdyqGKKytfmJwm/frwuujrRYLVnfWKn1nbdwmztcANoTf hBXL/a2O+KTQScg3m/axHzJtQuaEOUI8usifdqqvPmtDLnRP99GaJCA238XsOJ4hWBPY boZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=KO0WExq/gHwR9DEe69o/s4rzo4GEwimZkxdlRgtkdt8=; b=pPPMYV0QifXiOeivuw8Mp/f5Q2rhErQIUHy6Coq3P/t084+9kZNwbRzGMgbUSqfY6f 1kvaQwXdjymEeN0BPiQdOxZ5F/G1ZCI7u/FApxoO0noxxJ4jcZdhwqMiur3yr2NM248w KuRY9/kcORETLHetgOQQ1/dTQEuqxioTFG/lmBsumsI9vA0qLGI//iqEq+8ME/JiHnjA SAHF+4OUgQhF3L7HUiQ9g7byNnP22otEha6dapKrc2fhM1R0pxJLQNCxsrmCUrgaQ5A2 XCoAeW3k7ovG2l/Xc/ZZ+T4F7kacdSGeak42J7DJJERQTmRFM2tw2PeXwt/RQY7mK85K L8CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VorbS2Tw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id z8si1238130edx.338.2021.01.28.03.46.23; Thu, 28 Jan 2021 03:46:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VorbS2Tw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231331AbhA1LnY (ORCPT + 99 others); Thu, 28 Jan 2021 06:43:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231419AbhA1LnI (ORCPT ); Thu, 28 Jan 2021 06:43:08 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55D69C061573; Thu, 28 Jan 2021 03:42:28 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id j21so3172753pls.7; Thu, 28 Jan 2021 03:42:28 -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:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=KO0WExq/gHwR9DEe69o/s4rzo4GEwimZkxdlRgtkdt8=; b=VorbS2Tww05G2RqblM7MjH3U2m09eiWPvsMMzTgplJBDvbzex346FvkybynsGJxywL d/tTzS9AXbxEBBsRt3VBvVgOdiRb6Bg7EEO9MkK8OIAWNcKnAbl6GvcDUKGkXDKDVn1r UtFO0srYd92w9V1xeiiHEWp647E7S5z2ykDVb6TeRuoEYKGTP2CBfWwAvF/WrkCZFGiO a0UEfWtIXrq1z+ATFCuaOK5JiFZiEVAzYga0jeL3odQZuZ6aiMcDfYqhJefv1gbL+sUt vpJvYmwCao30fSrvvDxqmALvWKSaUPuNXbGoo9pNOXWB6rA+CdxQaZV96Y/KliwNM4ix pEEg== 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=KO0WExq/gHwR9DEe69o/s4rzo4GEwimZkxdlRgtkdt8=; b=hwK6bR6C8IQF/ARCfIME+m31sFK3Rl4am2Q+s38lOm/buRXe3Ovt+7/rvFyD+qi/Oo S9SSXS1QRg15JJeY5jM57o+05gKR2/XMv7+1Npap/beeA3MJU/Lw+iWNBI72fkH25B0e 1IcF+WlwZvQ/CjSrY0MIuRGWwLfnJbY0r9r+QSOPkcwDmetiFEggJkwnl9dIBo3X/gfQ KFJoJ3+fHk9p/oJOGsEgZpQJQBa4sCmc+Xjukvxgo0RGaXRusjoJMB54y9DgZ1lHY3Jy bJDapwhGfNaEOKt86h1KW1dAKPEr2eGCr9UeZYnEWTFD55VqK8CrDRpA6iWQPHmPNHv1 HXCw== X-Gm-Message-State: AOAM531QRliaoAa6OYSANgfpZ5Q3pMgukXIRF3AFFaDty/j5uJ+8M6h0 ACtU7/32piZga50yQ/fS2eE= X-Received: by 2002:a17:90a:eacf:: with SMTP id ev15mr10877278pjb.209.1611834147786; Thu, 28 Jan 2021 03:42:27 -0800 (PST) Received: from localhost ([103.220.76.197]) by smtp.gmail.com with ESMTPSA id w16sm2497434pfj.103.2021.01.28.03.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 03:42:27 -0800 (PST) Date: Thu, 28 Jan 2021 19:42:21 +0800 From: carlis To: Geert Uytterhoeven Cc: Kari Argillander , Greg KH , Colin King , oliver.graute@kococonnector.com, zhangxuezhi1@yulong.com, mh12gx2825@gmail.com, Stefano Brivio , DRI Development , Linux Fbdev development list , driverdevel , Linux Kernel Mailing List Subject: Re: [PATCH v10] staging: fbtft: add tearing signal detect Message-ID: <20210128194221.0000364e@gmail.com> In-Reply-To: References: <1611754972-151016-1-git-send-email-zhangxuezhi3@gmail.com> <20210127223222.3lavtl3roc4cabso@kari-VirtualBox> <20210128094258.000012c3@gmail.com> <20210128065233.ji4b7ea54ihyu2l5@kari-VirtualBox> <20210128190301.00007ebe@gmail.com> Organization: Tyzmig-ryrjum-8kedto X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 Jan 2021 12:15:28 +0100 Geert Uytterhoeven wrote: > Hi Carlis, > > On Thu, Jan 28, 2021 at 12:03 PM carlis > wrote: > > On Thu, 28 Jan 2021 10:42:54 +0100 > > Geert Uytterhoeven wrote: > > > On Thu, Jan 28, 2021 at 7:53 AM Kari Argillander > > > wrote: > > > > On Thu, Jan 28, 2021 at 09:42:58AM +0800, carlis wrote: > > > > > On Thu, 28 Jan 2021 00:32:22 +0200 > > > > > Kari Argillander wrote: > > > > > > > #include "fbtft.h" > > > > > > > > > > > > > > #define DRVNAME "fb_st7789v" > > > > > > > @@ -66,6 +69,32 @@ enum st7789v_command { > > > > > > > #define MADCTL_MX BIT(6) /* bitmask for column address > > > > > > > order */ #define MADCTL_MY BIT(7) /* bitmask for page > > > > > > > address order */ > > > > > > > > > > > > > > +#define SPI_PANEL_TE_TIMEOUT 400 /* msecs */ > > > > > > > +static struct mutex te_mutex;/* mutex for set te gpio irq > > > > > > > status */ > > > > > > > > > > > > Space after ; > > > > > hi, i have fix it in the patch v11 > > > > > > > > > > > > > > Yeah sorry. I accidentally review wrong patch. But mostly stuff > > > > are still relevant. > > > > > > > > > > > @@ -82,6 +111,33 @@ enum st7789v_command { > > > > > > > */ > > > > > > > static int init_display(struct fbtft_par *par) > > > > > > > { > > > > > > > + int rc; > > > > > > > + struct device *dev = par->info->device; > > > > > > > + > > > > > > > + par->gpio.te = devm_gpiod_get_index_optional(dev, "te", > > > > > > > 0, GPIOD_IN); > > > > > > > + if (IS_ERR(par->gpio.te)) { > > > > > > > + rc = PTR_ERR(par->gpio.te); > > > > > > > + dev_err(par->info->device, "Failed to request te > > > > > > > gpio: %d\n", rc); > > > > > > > + return rc; > > > > > > > + } > > > > > > > > > > > > You request with optinal and you still want to error out? We > > > > > > could just continue and not care about that error. User > > > > > > will be happier if device still works somehow. > > > > > > devm_gpiod_get_index_optional() returns NULL, not an error, if the > > > GPIO is not found. So if IS_ERR() is the right check. > > > > > > And checks for -EPROBE_DEFER can be handled automatically > > > by using dev_err_probe() instead of dev_err(). > > > > > hi, i fix it like below!? > > par->gpio.te = devm_gpiod_get_index_optional(dev, "te", 0, > > GPIOD_IN); if (IS_ERR(par->gpio.te)) { > > rc = PTR_ERR(par->gpio.te); > > dev_err_probe(par->info->device, rc, "Failed to > > request te gpio\n"); return rc; > > } > > if (par->gpio.te) { > > init_completion(&spi_panel_te); > > rc = devm_request_irq(dev, > > gpiod_to_irq(par->gpio.te), > > spi_panel_te_handler, > > IRQF_TRIGGER_RISING, "TE_GPIO", par); > > if (rc) { > > dev_err(par->info->device, "TE request_irq > > failed.\n"); return rc; > > dev_err_probe() > > > } > > > > disable_irq_nosync(gpiod_to_irq(par->gpio.te)); > > } else { > > dev_info(par->info->device, "%s:%d, TE gpio not > > specified\n", __func__, __LINE__); > > } > > Gr{oetje,eeting}s, > > Geert > hi,i will fix it like below: par->gpio.te = devm_gpiod_get_index_optional(dev, "te", 0, GPIOD_IN); if (IS_ERR(par->gpio.te)) return dev_err_probe(par->info->device, PTR_ERR(par->gpio.te), "Failed to request te gpio\n"); if (par->gpio.te) { init_completion(&spi_panel_te); rc = devm_request_irq(dev, gpiod_to_irq(par->gpio.te), spi_panel_te_handler, IRQF_TRIGGER_RISING, "TE_GPIO", par); if (IS_ERR(rc)) return dev_err_probe(par->info->device, PTR_ERR(rc), "TE request_irq failed.\n"); disable_irq_nosync(gpiod_to_irq(par->gpio.te)); } else { dev_info(par->info->device, "%s:%d, TE gpio not specified\n", __func__, __LINE__); } regards, zhangxuezhi