Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3224905imm; Thu, 17 May 2018 05:32:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZovvuQO2S1c7BZ6kCS4kZHgz8B5LVHUtxd9YzxiIx7Q1Wr2P7Fn0HdJB9IugyiqFXSkZ7Zj X-Received: by 2002:a17:902:323:: with SMTP id 32-v6mr5205452pld.312.1526560349934; Thu, 17 May 2018 05:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526560349; cv=none; d=google.com; s=arc-20160816; b=Oua7MLCvSI93kmtGGD8L/XKqpqHXoXzGrksuoclt+T815nz/+GIhn7Xwve1Gt+te9w /48HQ3qeiKfdVCVVgt/AUvR5uNrtDlsfajwHH5c2qGEU6zXAsK40QL89Bn6jUJpXHRZ+ gO0JnkGvkv/8MTZ9iUrHjR7tHAUwsBpTBFgj/IE9rv1MGVpSExZ0Typvp5gNXQgiTSbX uxJ1LzS3mkIieQUkiANvfTovrwOiKmLyYhzie9O9ubT5xO1WtYhQprRRiJOwanN8PVzj W1MMRtfXMnfUe7lx0Fi/RkR/PwjDU4/ORMnkSns38ORhWuGmp7ecarfg0/54p7aWkfJ8 BH9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=49pUsu0PqF1nEwfkPozfFJ6UjB8QntcpoplWAEFl/VQ=; b=YDHvx7NTbBvrCJhQ9/DI7gWnW2sGQopM7LrzSaSaBSJ9OKXVRgaCIKGiwVTCAsvDNT wa6EAtxpjMWpK0jW4PUSlivGXLLmSryUiQ3CESv3JuPHZqSI9SDfSKLHX63Ejq6gaouC FhGcSyNpiVQIpmVua8VT9K9X87QAIp/NSZnMU+NaaXXbYOVBvCHOOsyn4CVSk+fTRxyO OQfxXv4ARJmSr06lPnDmgzhTtUoJnXz/qy0aYNvTNyUJtnGw6n/tBSnA9GHqtkF9eIvD xyRh8ju+RRg3F+h7nMCOH//02mjqTGKWo1LyOELSfVdsc0qpa6IxJj/hkuq8s3cvRn2Z 4KWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1CAfYb6W; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p83-v6si5383305pfl.279.2018.05.17.05.32.14; Thu, 17 May 2018 05:32:29 -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=@kernel.org header.s=default header.b=1CAfYb6W; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751610AbeEQMcA (ORCPT + 99 others); Thu, 17 May 2018 08:32:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:39358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbeEQMb5 (ORCPT ); Thu, 17 May 2018 08:31:57 -0400 Received: from mail-qt0-f169.google.com (mail-qt0-f169.google.com [209.85.216.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0876220859; Thu, 17 May 2018 12:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526560317; bh=V72MxFK99+RfrUQHdLAlNR1kJFMAs2uyUkc/hNb4RAc=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=1CAfYb6WNqfEGHRpI1opkbeDEWvTOXgz4kAPdMFqU0y5iDKc5LV/U6WFqjXcLGMrf WoEoNuwAxV2IunZSOkfxiJERorOF5VKzcs5lXK3AeRcY+vKLriaZvZQQXqu1kCy6VE aY+G4vO85wkku2Z/AFMSgrsDBPr2MEGnuvJ6C1EU= Received: by mail-qt0-f169.google.com with SMTP id m5-v6so5466583qti.1; Thu, 17 May 2018 05:31:56 -0700 (PDT) X-Gm-Message-State: ALKqPwcjiyVJ1NvPBsoM0ZCQvJYJcRFtQi9xw/8b6rGKt1RWjfHyOWZ0 xzBSDdhGP/7X5FwKEYR0yZ1nU3IeZh50jQjO6w== X-Received: by 2002:aed:3bae:: with SMTP id r43-v6mr5028655qte.362.1526560316049; Thu, 17 May 2018 05:31:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.155.2 with HTTP; Thu, 17 May 2018 05:31:35 -0700 (PDT) In-Reply-To: <82fa847760309cb3382bf0a8da50162c@codeaurora.org> References: <1525341432-15818-1-git-send-email-kgunda@codeaurora.org> <1525341432-15818-3-git-send-email-kgunda@codeaurora.org> <20180507162004.GB2259@tuxbook-pro> <82fa847760309cb3382bf0a8da50162c@codeaurora.org> From: Rob Herring Date: Thu, 17 May 2018 07:31:35 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral To: Kiran Gunda Cc: Bjorn Andersson , Lee Jones , Daniel Thompson , Jingoo Han , Jacek Anaszewski , Pavel Machek , Mark Rutland , Bartlomiej Zolnierkiewicz , Linux LED Subsystem , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , dri-devel , linux-fbdev@vger.kernel.org, linux-arm-msm Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 17, 2018 at 4:47 AM, wrote: > On 2018-05-08 15:55, kgunda@codeaurora.org wrote: >> >> On 2018-05-07 21:50, Bjorn Andersson wrote: >>> >>> On Thu 03 May 02:57 PDT 2018, Kiran Gunda wrote: >>> >>>> WLED4 peripheral is present on some PMICs like pmi8998 >>>> and pm660l. It has a different register map and also >>>> configurations are different. Add support for it. >>>> >>> >>> Several things are going on in this patch, it needs to be split to >>> not hide the functional changes from the structural/renames. >>> >> Ok. I will split it in the next series. >>>> >>>> Signed-off-by: Kiran Gunda >>>> --- >>>> .../bindings/leds/backlight/qcom-wled.txt | 172 ++++- >>>> drivers/video/backlight/qcom-wled.c | 749 >>>> +++++++++++++++------ >>>> 2 files changed, 696 insertions(+), 225 deletions(-) >>>> >>>> diff --git >>>> a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt >>>> b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt >>>> index fb39e32..0ceffa1 100644 >>>> --- a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt >>>> +++ b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt >>>> @@ -1,30 +1,129 @@ >>>> Binding for Qualcomm Technologies, Inc. WLED driver >>>> >>>> -Required properties: >>>> -- compatible: should be "qcom,pm8941-wled" >>>> -- reg: slave address >>>> - >>>> -Optional properties: >>>> -- default-brightness: brightness value on boot, value from: 0-4095 >>>> - default: 2048 >>>> -- label: The name of the backlight device >>>> -- qcom,cs-out: bool; enable current sink output >>>> -- qcom,cabc: bool; enable content adaptive backlight control >>>> -- qcom,ext-gen: bool; use externally generated modulator signal to dim >>>> -- qcom,current-limit: mA; per-string current limit; value from 0 to 25 >>>> - default: 20mA >>>> -- qcom,current-boost-limit: mA; boost current limit; one of: >>>> - 105, 385, 525, 805, 980, 1260, 1400, 1680 >>>> - default: 805mA >>>> -- qcom,switching-freq: kHz; switching frequency; one of: >>>> - 600, 640, 685, 738, 800, 872, 960, 1066, 1200, 1371, >>>> - 1600, 1920, 2400, 3200, 4800, 9600, >>>> - default: 1600kHz >>>> -- qcom,ovp: V; Over-voltage protection limit; one of: >>>> - 27, 29, 32, 35 >>>> - default: 29V >>>> -- qcom,num-strings: #; number of led strings attached; value from 1 to >>>> 3 >>>> - default: 2 >>>> +WLED (White Light Emitting Diode) driver is used for controlling >>>> display >>>> +backlight that is part of PMIC on Qualcomm Technologies, Inc. reference >>>> +platforms. The PMIC is connected to the host processor via SPMI bus. >>>> + >>>> +- compatible >>>> + Usage: required >>>> + Value type: >>>> + Definition: should be "qcom,pm8941-wled" or >>>> "qcom,pmi8998-wled". >>>> + or "qcom,pm660l-wled". >>> >>> >>> Better written as >>> >>> should be one of: >>> X >>> Y >>> Z >>> >> Will do it in the next series. >>>> >>>> + >>>> +- reg >>>> + Usage: required >>>> + Value type: >>>> + Definition: Base address of the WLED modules. >>>> + >>>> +- interrupts >>>> + Usage: optional >>>> + Value type: >>>> + Definition: Interrupts associated with WLED. Interrupts can be >>>> + specified as per the encoding listed under >>>> + Documentation/devicetree/bindings/spmi/ >>>> + qcom,spmi-pmic-arb.txt. >>> >>> >>> Better to describe that this should be the "short" and "ovp" interrupts >>> in this property than in the interrupt-names. >>> >> Ok. I will do it in the next series. >>>> >>>> + >>>> +- interrupt-names >>>> + Usage: optional >>>> + Value type: >>>> + Definition: Interrupt names associated with the interrupts. >>>> + Must be "short" and "ovp". The short circuit >>>> detection >>>> + is not supported for PM8941. >>>> + >>>> +- label >>>> + Usage: required >>>> + Value type: >>>> + Definition: The name of the backlight device >>>> + >>>> +- default-brightness >>>> + Usage: optional >>>> + Value type: >>>> + Definition: brightness value on boot, value from: 0-4095 >>>> + Default: 2048 >>>> + >>>> +- qcom,current-limit >>>> + Usage: optional >>>> + Value type: >>>> + Definition: uA; per-string current limit >>> >>> >>> You can't change unit on an existing property, that breaks any existing >>> dts using the qcom,pm8941-wled compatible. >>> >> >>>> + value: >>>> + For pm8941: from 0 to 25000 with 5000 ua step >>>> + Default 20000 uA >>>> + For pmi8998: from 0 to 30000 with 5000 ua step >>>> + Default 25000 uA. >>> >>> >>> These values could be described just as well in mA, so keep the original >>> unit - in particular since the boot-limit is in mA... >>> >> Ok. Will keep the original as is in the next series. > > Here, I may have to go with the approach as in "qcom,ovp". Because for > pm8941 > the current step is 1 mA (I have wrongly mentioned as 5000uA here) and for > PMI8998 > the current step is 2.5 mA. Hence, I will add another variable > "qcom,current-limit-ua" > just like "qcom,ovp-mv". Use unit suffixes defined in bindings/property-units.txt. Rob