Received: by 10.213.65.68 with SMTP id h4csp2788557imn; Mon, 9 Apr 2018 09:02:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx49PuvBDmXPBdJkNnHYjbPx1nX23p5A3e0MlyKEAm/l96wa/3B+MAb0EtLyaRYoE5mTZz3cb X-Received: by 2002:a17:902:102:: with SMTP id 2-v6mr39443742plb.48.1523289779256; Mon, 09 Apr 2018 09:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523289779; cv=none; d=google.com; s=arc-20160816; b=c1GjMBLJGpz1d+YxiUxE9ZoaFF+IJkjV9QQ5sXvvPbvo341FE5DXdA/UvESdjM8r3m Zwzbd0RmMv/GuCnBHmIHXuN3MxMDXAYX1QY1iW01y3AntjvSMgRwk3TqRL34Ybz/W9lA dWPXwWEHRPBbxuLR2aeHhrWa8vlGhWr6NJ5fgpxc/0JwRZJT6rziT3/Cd+8DyHP2AxfC NT68derojAfbyZSiJAEJ66N/iDiWYnsVOpZTHyHATG/owCG86R5nyOL5r6TJEJ9FW/Mj A/nqwHcykcp70EAQI6pYSpbwy8L4YufaLdIGFM8+guaAyHWeXfJHO6Mhi1RrBBItnCUq 4kOg== 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:arc-authentication-results; bh=Wi+M7fL18/7p2oQr88SxdTmCz9HpM8jTbfaQ/PnXf98=; b=W6dqB1MlCCPQCpicCUk5Wmcx/lT29W3OSbkxk+9y9huf8W/t+mg+LWZWPJbn4vuwEh j1oTeDzPwW/LPED5oUOEUGNTHKQNSTjxJ9VzNGHt86Mk/L5uoei0jPHrHZWAcMPZAvWd NAWkGl3NlML3+KdqmlPUYZ9wg9ywCW8AguaWZFHTe4VOW/fUrIVWtLgbwgYxquVKbzmJ mcIQyGFHa2aPgZQkv1Mw05XF9C06IkXbKOOCKyUBe4vPs9aaDpqbdsO+xoTutwxlofew y9uNQEoQql9q70OV0BwQwUMMo9wYZZ+gK81mIudnw6LeJF0I4ehYU3I5CO0dXfcKjWCh ZEqA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si450528pfh.139.2018.04.09.09.02.21; Mon, 09 Apr 2018 09:02:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753308AbeDIPyk (ORCPT + 99 others); Mon, 9 Apr 2018 11:54:40 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:34766 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753035AbeDIPyi (ORCPT ); Mon, 9 Apr 2018 11:54:38 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 5882E279692 Date: Mon, 9 Apr 2018 17:54:33 +0200 From: Sebastian Reichel To: Pavel Machek Cc: Milo Kim , Lee Jones , Daniel Thompson , Rob Herring , Tony Lindgren , Jingoo Han , Mark Rutland , linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCHv4 08/10] backlight: add TI LMU backlight driver Message-ID: <20180409155433.zxqs2b2k2xzn6kon@earth.universe> References: <20180330172414.26575-1-sebastian.reichel@collabora.co.uk> <20180330172414.26575-9-sebastian.reichel@collabora.co.uk> <20180403104908.GD6758@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2na4yo3f6lfp4s6v" Content-Disposition: inline In-Reply-To: <20180403104908.GD6758@amd> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --2na4yo3f6lfp4s6v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Apr 03, 2018 at 12:49:08PM +0200, Pavel Machek wrote: > > +enum ti_lmu_bl_type { > > + TI_LMU_BL, /* backlight userspace interface */ > > + TI_LMU_LED, /* led userspace interface */ > > +}; > ... > > +static int ti_lmu_bl_add_device(struct ti_lmu_bank *lmu_bank) > > +{ > > + switch (lmu_bank->type) { > > + case TI_LMU_BL: > > + return ti_lmu_bl_register_backlight(lmu_bank); > > + case TI_LMU_LED: > > + return ti_lmu_bl_register_led(lmu_bank); > > + default: > > + return -EINVAL; > > + } > > +} >=20 > Ok, this is somehow unusual/crazy. Single driver with two > interfaces. >=20 > Do we need the LED interface for something? > > If yes, I believe reasonable solution would be to always provide LED > interface, and then have "backlight-trigger" which that would provide > backlight interface for arbitrary LED. Userspace expects keyboard backlight to be exposed via the LED subsystem and display backlight via the backlight subsystem. I considered always exposing the banks via the LED subsystem and using a generic backlight driver. That brings its own problems, since there is a dependency between the display and the backlight. This is described in DT using a phandle. Getting the right backlight device from the phandle will become very tricky with this approach. -- Sebastian --2na4yo3f6lfp4s6v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlrLjLgACgkQ2O7X88g7 +pppyw//R/dfe0kUn3Hw+xarTc6IIQBywupoH2tSnHBQYjj/KOsw5vhmwcJn1oOb PHPVyykxEF8UG7Ef1vwZrU1T7bAO374vL5VR6kI2BWjZWU43o7r5TunQRwLANRcg 3QbRlkoHXt503LgaYKsVA6jZ7AW421IMJtzlaEw2Fh+jMuyHfPdC2tGP2H8tAej0 TQTMnMmW5fxI01FkLrtgco4ixBRN0kpURex0VtAurI92wYXwXLnmerMgu2DLZs3e YNEvDOtFUgZUNLB+6IhwVUTP4Sra2XYpb451+fHMIv9qMy1asDGXzgtFh6362pv3 gvwIkR7i3nmCnkIqX/aNk30kyVUE6OpFCMoJIRHKCZSsWx+jOIC+xTHXxiEHdh5t qWQEtRGdQUkUH3mOGOqEcxW3GmBVugWFAN4J4ViSfXi3YCZ+sDZt4lXSn0ku2oT+ pqxVR6W54bNBtNFwWqQI9uauop+thVGeBK6j5mAuxCNs/F2RqlyePFSDczAFpq0L nckhvk8XzdYlkgpBxBKNO8qaqT4j0Zi5VIFonzQmSf3hfU2t1aC/TW5AtimO7fk4 Zf1v/bMdhJW6ta1R/9yi+AubJ+WXkFWfX4xumPYnx63qJGwelX+7LB12GxEv84Zz VOL46e8lW767dhBkTfE9qxW8kVpA9jxiAc/rEBqvPvjGxgs0yos= =TEg9 -----END PGP SIGNATURE----- --2na4yo3f6lfp4s6v--