Received: by 10.223.185.116 with SMTP id b49csp3015103wrg; Sun, 18 Feb 2018 11:53:17 -0800 (PST) X-Google-Smtp-Source: AH8x224551f4mmITvpfz3iqH+4Gj08xBiMK7g3ziMdXTJdRCU+rGddCqNd/tMOWiT4ehVQenN7JG X-Received: by 2002:a17:902:594c:: with SMTP id e12-v6mr12307828plj.323.1518983597238; Sun, 18 Feb 2018 11:53:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518983597; cv=none; d=google.com; s=arc-20160816; b=Kua1ewcO6ZdkVKj5KrA3yxLk/86yQoqs7wSVWTjv4VpxtDQkZo/CRn52cBvIWS0fVq +Ba2OkmOQ61ZX+tQTNBAX0vFPWFmxSeI2SF7nv9ghzQjdE+nQZKFloDnTOFwzvKxEFX1 SMqLlHQLA3bbE/RnhoGHKb4oxnUctWR4cQEl5MyCU23/YuCzyCcmnvIvDVlkcJ8B83oZ ASoHW2n0IkFQu3DCPOqfFKsL1/y0aCnRr8nVwDcbeAkAFQdtekAaEQZdU+JJ2qx04yTE lYv9iMbR4Iv+ep/86TaVFX5WSUTIYGpSUS6YqckRGicUgTW7/X7LHYzt+YIoy/nhPE0P L8wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=d8SsYoEC/v7ATaq1xGUnuNW6gm81uaukveDp6lCxztg=; b=Su9UxWsPRCkxFn+WGxEoWg0rYo4IZE9lFLSOpXRZWMaqrNBoVtl13ohN0i3USilKPT wqaU9ZONcLYHnYZmo6wBGSpZm6XhZiKIM30lqX+aWQS8J3rOsCxGlIQzmxlbyGQtB28H 1A1xNsox6Y8UGmgi0hliqYYeffBm8tRfYEbrdOtJOnE5tUlpm48ufdQKEig+BiYfqPdj lQCmLV+JqntSfeSlYmhp7aih25P2ctGStLBmRpWIYsqXkXrkKCMLNtZ5i7yHKGxDeWHf x56BFwZmPVMYGCFXkoleHX5vbNk4llZzQe2v8OaWfUh9R2K6W7R0TtshyDO68/XymrbH Dagg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kempniu.pl header.s=google header.b=lelblQj6; 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=REJECT sp=REJECT dis=NONE) header.from=kempniu.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si2627286pgu.470.2018.02.18.11.53.03; Sun, 18 Feb 2018 11:53:17 -0800 (PST) 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=@kempniu.pl header.s=google header.b=lelblQj6; 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=REJECT sp=REJECT dis=NONE) header.from=kempniu.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751758AbeBRTv7 (ORCPT + 99 others); Sun, 18 Feb 2018 14:51:59 -0500 Received: from mail-lf0-f42.google.com ([209.85.215.42]:47081 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbeBRTv5 (ORCPT ); Sun, 18 Feb 2018 14:51:57 -0500 Received: by mail-lf0-f42.google.com with SMTP id r80so45096lfe.13 for ; Sun, 18 Feb 2018 11:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=d8SsYoEC/v7ATaq1xGUnuNW6gm81uaukveDp6lCxztg=; b=lelblQj6wHCA+smRh/hlfr5Moj5+s0d9R/LXWqthFEaqc+uzkYZq0eAboPCFR68ADK 75kV69RVm7WJn+3xJIDs6gVotYUxXCaxqabb7+ItV5+1Hs8Vsp9sK3E1bJfY9A2U/3Xe NdL6lGcXyxt8NnZv/4GsA35v29usVq3k9kyPI= 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:content-transfer-encoding :in-reply-to:user-agent; bh=d8SsYoEC/v7ATaq1xGUnuNW6gm81uaukveDp6lCxztg=; b=bD3gq9Wsvj8HA8rjsKaQiOCTrUjHqMp1G4nwsLJMNTPke43+TRLEcXRLHmPNnNiPMy BmfAVuPdV2KUidQBdYyjcMtxuEMMcpaXIzoggYg9yBeQVR+IZkqdC5bvrsmSFp3FmEp6 zHI7wsQPtmrMxlJG22HCGRo8Rn7FRBELh2qyOJ77u+nPqRbj+72zBmuz1Q/DYRzL9gdO hONzR8IoVT/uNlMKLosiNkGMKe7kYDGXIcQuIxJP09+0gw9h9rN4vrNQ8Hmt4iA+Y5rJ ZJnpWRlRhA7wQ3lk4yRMjLmZkVD6IZc13z4nmgCJtZx0GrBCXmb80eqih3vtj2NWRW/n ZIWw== X-Gm-Message-State: APf1xPCEpeWYFsSz4l6CDi2j91abw00HmZ4ybsMUyMzDSU944TfHO7w/ ImWy7MPaQ58PSfQ8h96FFJ/cTg== X-Received: by 10.25.79.19 with SMTP id d19mr8080009lfb.59.1518983515921; Sun, 18 Feb 2018 11:51:55 -0800 (PST) Received: from kmp-mobile.hq.kempniu.pl (kmp-mobile.hq.kempniu.pl. [2001:470:64df:111::1b01]) by smtp.gmail.com with ESMTPSA id r3sm891513lje.96.2018.02.18.11.51.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Feb 2018 11:51:55 -0800 (PST) Date: Sun, 18 Feb 2018 20:51:53 +0100 From: =?utf-8?B?TWljaGHFgiBLxJlwaWXFhA==?= To: Jonathan Woithe Cc: Darren Hart , Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/7] platform/x86: fujitsu-laptop: Define constants for backlight power control Message-ID: <20180218195153.GA3665@kmp-mobile.hq.kempniu.pl> References: <20180211210727.12130-1-kernel@kempniu.pl> <20180211210727.12130-7-kernel@kempniu.pl> <20180216105014.GB25974@marvin.atrad.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180216105014.GB25974@marvin.atrad.com.au> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +/* FUNC interface - backlight power control */ > > +#define BACKLIGHT_POWER 0x4 > > +#define BACKLIGHT_OFF 0x3 > > +#define BACKLIGHT_ON 0x0 > > A minor detail: BACKLIGHT_OFF and BACKLIGHT_ON are potential parameter > values while BACKLIGHT_POWER is essentially a parameter selector. Should > the name of BACKLIGHT_POWER reflect this difference? It could be difficult > to do without making the resulting identifier a little long. The best I can > come up with is BACKLIGHT_PARAM_POWER or (if a saving of one character is > desired) BACKLIGHT_PARM_POWER. So, I tried to somehow unify constant naming throughout the module a few times by now, but it seems that whichever naming pattern I chose, there was always some exception to the rule. Of course the module code is not to blame, it is caused by the firmware treating logically related features (like controlling various LEDs) in diverse ways. Thus, I am perfectly fine with using BACKLIGHT_PARAM_POWER for now, because I do not have a better idea yet. If I ever come up with a constant naming scheme that would cover all the constants in the module (or at least all those directly related to call_fext_func()), I will propose it here. > > @@ -818,7 +825,8 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) > > /* Sync backlight power status */ > > if (fujitsu_bl && fujitsu_bl->bl_device && > > acpi_video_get_backlight_type() == acpi_backlight_vendor) { > > - if (call_fext_func(fext, FUNC_BACKLIGHT, 0x2, 0x4, 0x0) == 3) > > + if (call_fext_func(fext, FUNC_BACKLIGHT, 0x2, BACKLIGHT_POWER, > > + 0x0) == 3) > > fujitsu_bl->bl_device->props.power = FB_BLANK_POWERDOWN; > > else > > fujitsu_bl->bl_device->props.power = FB_BLANK_UNBLANK; > > I'm curious: this fext function call is, I think, returning the current > backlight power value. If that's the case, is the value of 3 used in the > test of the return function conceptually BACKLIGHT_OFF, and if so, should we > use BACKLIGHT_OFF instead of the numeric constant? It seems likely given > that it results in the backlight power property being set to > FB_BLANK_POWERDOWN. Ah, yes, good catch. Will fix, thanks. -- Best regards, Michał Kępień