From patchwork Wed Apr 25 17:42:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10363997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52367601D3 for ; Wed, 25 Apr 2018 17:43:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4570728D7F for ; Wed, 25 Apr 2018 17:43:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39C5728FC2; Wed, 25 Apr 2018 17:43:17 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AFAC828D7F for ; Wed, 25 Apr 2018 17:43:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21C7F6E63F; Wed, 25 Apr 2018 17:43:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0936C6E27E for ; Wed, 25 Apr 2018 17:43:09 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id j4so8574914wme.1 for ; Wed, 25 Apr 2018 10:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UPlCIE1MTTIAvDrTIh4185XwaY2phlIhNBlZNABLUpw=; b=MDurK95j3vE9oRc8sihcsaaToM6IArCNSLDvTHcnqSdq7Qpayp8ra2MMbpDy7zntPh /wj3s3IS29AVDu+mV/ObdUJaZM3VhNCqA2Uv8pSBxQbAtBmwLH59o4UR4QBlD4X3bsBU 30wT2cH2tpLbLUvdE7Kl0ZkpmBhAPgAgc3MfQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UPlCIE1MTTIAvDrTIh4185XwaY2phlIhNBlZNABLUpw=; b=GJgEvNC7Jt65sJ7Jm47+aHHXgiHPM3ws9h2oGy/E9mPXIr/QNIAtsSIHpHp3eeqwnu jVwokMWZsu9c9KjicKsUkkfgZzXqnYFQnbmztnZFzxtf/dSJP+0WW9ENEu31anb/qspR pq6ANM10cu9so/Xq6uikggk/jNQKbnQo2mZ/Bqhnl3YPeUwa0DL8hh5JLBrxb3B4ZMT0 iuIRGsceLAKrA2ofUGTy/0v7nTceGeOERIZtd1E492nT22ixgq58d3X/cJJ7ZPo3cPwJ FYh+mieLSh/KQQV0VKBVFIHHV6moed3Vz7UfhJ+lfEt/BFUBk3sqQPuTLE7Qpg4NOOHr wV3A== X-Gm-Message-State: ALQs6tCjTUuDXLHTRBWWgEJCT5O6w19XsSaErEtIF6ic/Lf92V2GhC+a NBLUOL/0LeUbE0qXPgHtiwz3R/N7 X-Google-Smtp-Source: AIpwx48haiJh/VIgL3up3t9bpjTQxCQjSVlHS5TkRR38XPvJRwKMfu+CoTvCjjB9kBnPw+xLBG55eA== X-Received: by 10.80.215.215 with SMTP id m23mr32892231edj.19.1524678187411; Wed, 25 Apr 2018 10:43:07 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id n8sm10962437edb.5.2018.04.25.10.43.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 10:43:06 -0700 (PDT) From: Daniel Vetter To: DRI Development , LKML Subject: [PATCH 4/6] staging/fbtft: Stop using BL_CORE_DRIVER1 Date: Wed, 25 Apr 2018 19:42:51 +0200 Message-Id: <20180425174253.4616-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425174253.4616-1-daniel.vetter@ffwll.ch> References: <20180425174253.4616-1-daniel.vetter@ffwll.ch> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Daniel Thompson , Daniel Vetter , Jingoo Han , Daniel Vetter , Lee Jones MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Leaking driver internal tracking into the already massively confusing backlight power tracking is really confusing. Luckily we have already a drvdata structure, so fixing this is really easy. Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han Cc: Thomas Petazzoni Acked-by: Daniel Thompson Signed-off-by: Daniel Vetter Reviewed-by: Jani Nikula Acked-by: Greg Kroah-Hartman --- drivers/staging/fbtft/fbtft-core.c | 4 ++-- drivers/staging/fbtft/fbtft.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 0e36b66ae5f7..731e47149af8 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -246,7 +246,7 @@ static int fbtft_request_gpios_dt(struct fbtft_par *par) static int fbtft_backlight_update_status(struct backlight_device *bd) { struct fbtft_par *par = bl_get_data(bd); - bool polarity = !!(bd->props.state & BL_CORE_DRIVER1); + bool polarity = par->polarity; fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: polarity=%d, power=%d, fb_blank=%d\n", @@ -296,7 +296,7 @@ void fbtft_register_backlight(struct fbtft_par *par) /* Assume backlight is off, get polarity from current state of pin */ bl_props.power = FB_BLANK_POWERDOWN; if (!gpio_get_value(par->gpio.led[0])) - bl_props.state |= BL_CORE_DRIVER1; + par->polarity = true; bd = backlight_device_register(dev_driver_string(par->info->device), par->info->device, par, diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h index e19e64e0d094..c7cb4a7896f4 100644 --- a/drivers/staging/fbtft/fbtft.h +++ b/drivers/staging/fbtft/fbtft.h @@ -229,6 +229,7 @@ struct fbtft_par { ktime_t update_time; bool bgr; void *extra; + bool polarity; }; #define NUMARGS(...) (sizeof((int[]){__VA_ARGS__})/sizeof(int))