Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1038772pxk; Thu, 10 Sep 2020 05:39:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW1x43nY5qegjuVveg6YxVrmLIjfBvmWaNFtgVTCs4mBcZXH6YIdMOWopYUVCMd8H58oXK X-Received: by 2002:a17:906:30c5:: with SMTP id b5mr8698738ejb.98.1599741562742; Thu, 10 Sep 2020 05:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599741562; cv=none; d=google.com; s=arc-20160816; b=Lz+Vb6+c4jADcSDemDtfcza3IX8C1v76tCdNgjsaGPuOAavg1dQ3DpnXfOt5U8vD+y 3Akk4/s7r9fn6EGo0P46qHSbT+TYKK72SVzTekT4W0ImcpSNbtQMpoPBB06uIdxIXNIz iOVAn/SxtXR7cC4gjOhVcoq5PCbas7fWHCDvWXTtUxLo9PRFoIQAaGcWi8yP/Ecbo8Oa 5qRAy8yDpjlq5pEQonXjOlnacgMH0/d2k5b5LfxCCcJB05+jOJP91OKVqQpvetazNytc 4gjdsG3X6tBdqbnW/3U6AdcBkfJ6wF/SGU7rXZ3jlFwUWNz8qGhy0gnwtJZrh0oDqhuF q65A== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Izlu2i4UF0unZV3zvlY5h6pA4Ipxs60M6toE+PWPPNA=; b=sS17+WKa4DVyN3bI9bxgpVsfcnLsTmvhNjaf472ax48tica5pv8gVJLkNsFQ8tT7dt BLR9BUxRJorS6XbRIUXiu3Zi2ERAgldcESAIDG0PU2w8B3Az/Uxgr2RZRZjfP4SalxCu wrncsGQuzSI7RUmz2M6Nqyd/Ib+uhW5LLqO+hw7/eAGoWbPDoISCOMJHyc057R5og3mt AQvpkW+K8EhQUdvPG6khl2GUU2bk4gFt57MCd9jKVjEvFkt7ZNLBMo3rzIXH83JIu3zX PQ6JGXV2UueAKkpaw6a3Wi4AWDSHYmFcxjOnvll0RAgt47oYboEZHJXHtnzAjZXPAZWc Ot4Q== 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 y11si3487202edp.213.2020.09.10.05.38.58; Thu, 10 Sep 2020 05:39:22 -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 S1730776AbgIJMft (ORCPT + 99 others); Thu, 10 Sep 2020 08:35:49 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:42638 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730692AbgIJMaB (ORCPT ); Thu, 10 Sep 2020 08:30:01 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 3FBB81C0B9C; Thu, 10 Sep 2020 14:29:59 +0200 (CEST) Date: Thu, 10 Sep 2020 14:29:58 +0200 From: Pavel Machek To: Gene Chen Cc: jacek.anaszewski@gmail.com, robh+dt@kernel.org, Matthias Brugger , Dan Murphy , 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 , 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: <20200910122958.GF7907@duo.ucw.cz> References: <1599474459-20853-1-git-send-email-gene.chen.richtek@gmail.com> <1599474459-20853-2-git-send-email-gene.chen.richtek@gmail.com> <20200908222544.GF1005@bug> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b8GWCKCLzrXbuNet" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --b8GWCKCLzrXbuNet Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > +{ > > > + struct mt6360_led *led =3D container_of(lcdev, struct mt6360_le= d, flash.led_cdev); > > > + struct mt6360_priv *priv =3D led->priv; > > > + u32 enable_mask =3D MT6360_TORCHEN_MASK | MT6360_FLCSEN_MASK(le= d->led_no); > > > + u32 val =3D (level) ? MT6360_FLCSEN_MASK(led->led_no) : 0; > > > + u32 prev =3D 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? > > >=20 > 1. set FLED1 brightness > # echo 1 > /sys/class/leds/white:flash1/flash_brightness > 2. enable FLED1 strobe > # echo 1 > /sys/class/leds/white:flash1/flash_strobe > 3 . turn off FLED1 strobe (just used to gaurantee the strobe mode > flash leds must be turned off) > # echo 0 > /sys/class/leds/white:flash1/flash_strobe I believe I'd preffer only exposing torch functionality in /sys/class/leds. .. strobe can be supported using v4l2 APIs. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --b8GWCKCLzrXbuNet Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCX1ocRgAKCRAw5/Bqldv6 8rt4AJ9KG5MVkOwIvtgD8oMHciHuYgq6xACgr/xJtQFK7Gi7zFnj7BU/D11YyD4= =WnaO -----END PGP SIGNATURE----- --b8GWCKCLzrXbuNet--