Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp121262ybi; Thu, 13 Jun 2019 12:44:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGzpA5zyP73fcJzpTjVyVQhOni3GLxk9vs8nYUzcov1I/KtjbOlk14v1bFLVOYB/R093kB X-Received: by 2002:a63:4c0f:: with SMTP id z15mr31669270pga.245.1560455089647; Thu, 13 Jun 2019 12:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560455089; cv=none; d=google.com; s=arc-20160816; b=QHtet3UGKYld7D2IFVGBzyDmRh7EoIrrBEJw9XVCpdk6hA4G8gHdIMQ6jdPnihq2Y+ RPNbqXfDpINxyBDixGewhzAg+Muvw5nq4hlpyoHkUfUYZcLgCnrlWgQ8fcZsRwKyj0vp v2AxMSqmE+L940ksi0vyDAHHGXyyWkg7ZRvYTeX3p7c1L5MoTRabtrUriwqLvNul1awb Y8O3970MUrTm/3v4ki5wASNEMGdVzOI2mkY283voBYkmF1Ql+dDQLe1PFRUvuDANM3oL XN+zZIWa35XyieF9vCpRMX4vDTEraovmAidevScCMxcpgFQJVJ2cjp008Tqa6hmZUHbM AqUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AB616NjBSa9Vj9zUvVGBmMFoqPgqn8QM9MSbUPc9ICQ=; b=SLYLOOsyv8C0dlj7CTMFPB1zqxCVGDnqzC0P1DNsYhJRCK+eIbfBbIrcqpC1owqjCY jjszofnwDO+g4Dj9EdiwsEMNKcWl23ExQ6fquDsXhxgFXwvDigqZ7h7OsCLWv9Rf7jnx 7/g2hAtW66NU80JawwUmDOeFWhsfXGR9UDOTZqgSVWbqYLMb0Xg9uM38BSk10su3sGBo vkdBlmLj1mzUXGr7kGAoFc7i2HC64E0ICBlWJhiPoOht4y+k7YRVel/mAf10IOHm6X0N cjM7HSZByDJBfw5vTYxsUMrb46sWmAdzhjN3MGhuiQAnAHpTeAZvoMGZ5yw04eXgdGsV f8eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Yxrvkmix; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si419799pjf.88.2019.06.13.12.44.34; Thu, 13 Jun 2019 12:44:49 -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=@chromium.org header.s=google header.b=Yxrvkmix; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729697AbfFMTnu (ORCPT + 99 others); Thu, 13 Jun 2019 15:43:50 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:38754 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729287AbfFMTng (ORCPT ); Thu, 13 Jun 2019 15:43:36 -0400 Received: by mail-pl1-f194.google.com with SMTP id f97so8588471plb.5 for ; Thu, 13 Jun 2019 12:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AB616NjBSa9Vj9zUvVGBmMFoqPgqn8QM9MSbUPc9ICQ=; b=Yxrvkmixlfb/dkkn3muC+q7KBymUNvGxf3uq8JFtc1veDsLcXzlkkbky+1KOMyJJy5 AUXgm4wSct7l+DLpaom1h3YgZ53bhvH7VMit/r23M13Zf7UJXpiZNBMpf5qKt8L5WZzR JCW00YgMSqhmw+cLWJ4x1BT1ucklGqtUb1zYA= 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:mime-version:content-transfer-encoding; bh=AB616NjBSa9Vj9zUvVGBmMFoqPgqn8QM9MSbUPc9ICQ=; b=ghvohSrTsJ/wcKYG6CSSOgB2cdfo2J+Qccz0/b7h0zk7XQGgcbE59cHo76m0brYGmL PAynV9W31dC5+oVlKHL/gJeodPf5V0QA9MvYUHc2je7GwesmxLDTCbuHCA4GWyf6e6yX AG7E29oC8t0CM7VMndQ1UZ+1OIiAz7p4oA6K6kLqfJBZByq9WD6Jv+D4bZj/ujA9RCne N6KddABkdIt1vYePvQ67Qfy2LPo+LAMmDKK9Vmxu6OPvslTILSKxTVUDa7UBKDRo0V4a NP2LZZYGl4RS87ALEtFpgFI6ICdMN8MJl3UFDx1oRjqbKMGoaQ+D27lQZeN6uzvfB3bA FrzA== X-Gm-Message-State: APjAAAXXS8CsLzErJTDDC2UBM9Xaw9UiDuvcbibgulEFcs1+j2iugH5Z kcrWb6wgSFBu+631ZrRw7RZOtw== X-Received: by 2002:a17:902:d695:: with SMTP id v21mr72975853ply.342.1560455016086; Thu, 13 Jun 2019 12:43:36 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id b17sm525029pfb.18.2019.06.13.12.43.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 12:43:35 -0700 (PDT) From: Matthias Kaehlcke To: Thierry Reding , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz Cc: linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Enric Balletbo i Serra , Douglas Anderson , Brian Norris , Pavel Machek , Jacek Anaszewski , Matthias Kaehlcke Subject: [PATCH 3/4] backlight: pwm_bl: Set scale type for CIE 1931 curves Date: Thu, 13 Jun 2019 12:43:25 -0700 Message-Id: <20190613194326.180889-4-mka@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190613194326.180889-1-mka@chromium.org> References: <20190613194326.180889-1-mka@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For backlight curves calculated with the CIE 1931 algorithm set the brightness scale type property accordingly. This makes the scale type available to userspace via the 'scale' sysfs attribute. Signed-off-by: Matthias Kaehlcke --- drivers/video/backlight/pwm_bl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index fb45f866b923..f067fe7aa35d 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -553,6 +553,8 @@ static int pwm_backlight_probe(struct platform_device *pdev) goto err_alloc; } + memset(&props, 0, sizeof(struct backlight_properties)); + if (data->levels) { /* * For the DT case, only when brightness levels is defined @@ -591,6 +593,8 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->levels = data->levels; } + + props.scale = BACKLIGHT_SCALE_CIE1931; } else { /* * That only happens for the non-DT case, where platform data @@ -601,7 +605,6 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->lth_brightness = data->lth_brightness * (state.period / pb->scale); - memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_RAW; props.max_brightness = data->max_brightness; bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, pb, -- 2.22.0.rc2.383.gf4fbbf30c2-goog