Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4265937pxk; Tue, 8 Sep 2020 15:27:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc+tV6cU1WRQ3AcRy5W6JXAJNqTMEi5dtMExZ8c+eAQlXo4sp0YoCQFi5QAUrd4W82VTxy X-Received: by 2002:aa7:cb83:: with SMTP id r3mr1203879edt.35.1599604048003; Tue, 08 Sep 2020 15:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599604047; cv=none; d=google.com; s=arc-20160816; b=Yi0z5hPTSl7mIdurTmlx0aDQUWHUkvnYnNf1kuEngy88CLSGEiblJffLMg0IAO3DdU MPpdKwcguHb/hw9F2OM9EI5NDEzFIf7vdD2SyWRLQ1auP04bUe4v1JgkhSyrRuvYvNR1 r7ywh9nr2dOu48zcQBo+WNuZQ/vG8VfP9ReZdK9tWD9aeWoM2MtRmXuAY8HDxtLVTWi1 J/YwiKk3oO7sFHf8qz6l5RDSYk2pM2Y//pOErteqr+/tbcNW+DLQsQmfYAj+tTT0D5Od 9Q7kwp3RbJuvUX6hO5Kva3m0o49r7g1ce+lzB+eVVFmFIiIkQKo5U6iSsTpCuJmFduDh eFRg== 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; bh=JaXc/WnjKcQnONTDoKq+73y1yN+Pe1bNe+hwCG4p+4U=; b=0Pg7PozgESZv26Ban015VxZ0DPmu4VGFgoQT7O3ftVqrVoePfbiYg1V8qBdvI8auhP oW8bUktOA+8CO65qpoDm2xyEacmF3Druyeo9WiPDhFgEzZTej02mL+LbpvOxZaNu3Fq5 vmDG/kw50jArefICzkRmUnUFJghlQI+1zzGF+C0S61WrbMYlcUVMWXEVKcrkQc9YX4NO CaHUz8Llf5aIyLUROoHiMowzq1d348hnJQY8ETcu0Ckyme0KDUt90+m0Y4xPbFyFrvlg xr/Vtn1Uq1KNbCNmigonzYAlKd+li+9frPlEJplATklJKUWiXgCEM47lJhFKhU4+86dS 69lA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si213088ejj.123.2020.09.08.15.27.04; Tue, 08 Sep 2020 15:27:27 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729799AbgIHWZv convert rfc822-to-8bit (ORCPT + 99 others); Tue, 8 Sep 2020 18:25:51 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:59638 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729622AbgIHWZs (ORCPT ); Tue, 8 Sep 2020 18:25:48 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id CEECC1C0B87; Wed, 9 Sep 2020 00:25:45 +0200 (CEST) Date: Wed, 9 Sep 2020 00:25:44 +0200 From: Pavel Machek To: Gene Chen Cc: jacek.anaszewski@gmail.com, robh+dt@kernel.org, matthias.bgg@gmail.com, dmurphy@ti.com, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com, benjamin.chao@mediatek.com Subject: Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360 Message-ID: <20200908222544.GF1005@bug> References: <1599474459-20853-1-git-send-email-gene.chen.richtek@gmail.com> <1599474459-20853-2-git-send-email-gene.chen.richtek@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <1599474459-20853-2-git-send-email-gene.chen.richtek@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > From: Gene Chen > > Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, > and 4-channel RGB LED support Register/Flash/Breath Mode > > Signed-off-by: Gene Chen > --- > drivers/leds/Kconfig | 11 + > drivers/leds/Makefile | 1 + > drivers/leds/leds-mt6360.c | 681 +++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 693 insertions(+) > create mode 100644 drivers/leds/leds-mt6360.c > > + help > + This option enables support for dual Flash LED drivers found on > + Mediatek MT6360 PMIC. > + Independent current sources supply for each flash LED support torch and strobe mode. > + Includes Low-VF and short protection. > + 80 columns. And perhaps user does not need to know about protections... and actually about independend sources, either. "Enable this for RGB LED and flash LED support on..."? > +static int mt6360_torch_brightness_set(struct led_classdev *lcdev, enum led_brightness level) > +{ > + struct mt6360_led *led = container_of(lcdev, struct mt6360_led, flash.led_cdev); > + struct mt6360_priv *priv = led->priv; > + u32 enable_mask = MT6360_TORCHEN_MASK | MT6360_FLCSEN_MASK(led->led_no); > + u32 val = (level) ? MT6360_FLCSEN_MASK(led->led_no) : 0; > + u32 prev = priv->fled_torch_used, curr; > + int ret; > + > + dev_dbg(lcdev->dev, "[%d] brightness %d\n", led->led_no, level); > + if (priv->fled_strobe_used) { > + dev_warn(lcdev->dev, "Please disable strobe first [%d]\n", priv->fled_strobe_used); > + return -EINVAL; > + } So... how does its userland interface look like? Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html