Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8565770ybn; Tue, 1 Oct 2019 09:54:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKsfKwxMCGvoGQxmY5TimE5MxdVuhRf9Cx2j8T5ehlImlsSIkqEuGhtodN/w5RVS+3DzMB X-Received: by 2002:a17:906:3d62:: with SMTP id r2mr20030762ejf.108.1569948864886; Tue, 01 Oct 2019 09:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569948864; cv=none; d=google.com; s=arc-20160816; b=au4A3ZQcAal3vs94BT9M7i7qWMD6Uvrs02XCGBKhX0PZ3t2O8DnnvVKNFaQ/7yrMwJ uPkqhsTyKEyJ5JgqMoWiRxEhvpTcD0U3vJtJ/OZNncS6kqYGikeNop3Ok4/qDaaT0RYa kYo9g71P2qbOfNiJGZKGI5ZYrnix2/f4I1DAlGDMU1mM2MoQLLyvRVhGGpWf8XmEOX5T 6p/7BIKDJJ7lfsEw2c37OvDU9h+L5skMlRvTYFMXgyG33UIkUqd4Cmlceha+ptcf/aEx aSGZtXl4qRIyzP6c5jR3LoObAOKza17jDsJUgJ5wXkQXqshCD6wCqlJQ+9lK0ldVVgkS k5JQ== 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 :in-reply-to:references:mime-version:dkim-signature; bh=tdLG/r7+P2Ngh8ZWtcYEEBy7N3f+Jkee88RnUZ/onlY=; b=S5GW+C5dhKiogQFbxErD/5a6tWWitBXwhRGPivon3C6EfI5/dRhKa5R86pVUY7HyYH 0oBqDSvqMp1N20O308beNkFVZ6/7cpFyIfyh1TBXCA4gJZ4gkzb/5f+3SBny27euGLht bMq+RqeATFzWIXXMsjnE8aMOlG2VgZ3qW1cUPJ5kKKdvaSapNOWjwD54meTO43JmIDSd u5FoBD6pg5DRKpH9Go0c5ZgihdIR7xhubRRGfP+cemipuNmXXlUhgYabOvXkF9+57WsN JCWK4dW4Dd2c5eUJHI3F+/BNoz5+PiZPfb/lM210afEjTu9ZMvlK5KQS/Uy+cBM2W7Fj +1sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="WG8m/x9u"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a54si9523794edc.333.2019.10.01.09.54.00; Tue, 01 Oct 2019 09:54:24 -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=@google.com header.s=20161025 header.b="WG8m/x9u"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732540AbfJAQnR (ORCPT + 99 others); Tue, 1 Oct 2019 12:43:17 -0400 Received: from mail-yw1-f49.google.com ([209.85.161.49]:45515 "EHLO mail-yw1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732484AbfJAQnL (ORCPT ); Tue, 1 Oct 2019 12:43:11 -0400 Received: by mail-yw1-f49.google.com with SMTP id x65so5039728ywf.12 for ; Tue, 01 Oct 2019 09:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tdLG/r7+P2Ngh8ZWtcYEEBy7N3f+Jkee88RnUZ/onlY=; b=WG8m/x9u6EkqT3rbeISwibZR7wgr+y475s8ZYI+aKyhwk79T6y6VPB35Cs3YbjtDOu DMmMM05x8SATtUB1NF3jvKOnIBm+Ma+zsUa1igpmoXAVCEj36LiGlKAZn8XriduTz/+X lXFMHVYW3vWZlla1cL3hfo+Ya47QiCoBw+zgqJ17l477sI6j+qm6bmUNF9e2cC+Xekee RcWy0oOSfg3sY79agjSWAuQSmKt8Mwf5LSDuwLv3fISsnvpixqEd0RHOkYvTTRNwzJZQ JPt/3eSuKe93B93Vts+/m6/wQLLYAFHappRoIYpDavTNDUoJf1WUg1G+EJ56VfVcT672 4/lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tdLG/r7+P2Ngh8ZWtcYEEBy7N3f+Jkee88RnUZ/onlY=; b=GiTTr3Bt9z5q6OmRzvsiXf4zWtFKAY03MM57ibR+HU3FuG2TkJXmHLT180ff2/pU3C VWGhTv//Rj2k48mD+RCPEEaK+tu2nkKNY91Kkj4OqK03sXrMr+mF2GKFr/IauUVcsnfR oMARTosj+oiRi4JbjJwqUlFRVcyDsvyA0eX3frUZEyAQXtkGm7l+h2pVqOARYolI4QNt cQ1P+ZXDOifr2hb1ovnvDyt+aVvVZ0Gw80gFfvPuGZbUc5LnI1LlThbln1IAmbt7TBvP ncB9gaOskK1aejV1ppBdRDX5Ygozr+en1wJulPeA1esNRc5N7TE6+MymL4tAnB/yyJGu ij3g== X-Gm-Message-State: APjAAAXehrc+KiRdV8CemQpnLUntPi5u1tbREj4OdnY+tB+nzjbV+oU4 Y8sEufyuQ4DlCCyWApv4QJC66jZtvW6BvTqlJqJ/iPbr38bKtQ== X-Received: by 2002:a81:a144:: with SMTP id y65mr16843887ywg.437.1569948189853; Tue, 01 Oct 2019 09:43:09 -0700 (PDT) MIME-Version: 1.0 References: <20191001162710.GB3526634@kroah.com> In-Reply-To: <20191001162710.GB3526634@kroah.com> From: Mat King Date: Tue, 1 Oct 2019 10:42:58 -0600 Message-ID: Subject: Re: New sysfs interface for privacy screens To: Greg KH Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, rafael@kernel.org, Ross Zwisler , Rajat Jain , Lee Jones , Daniel Thompson , Jingoo Han 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 Tue, Oct 1, 2019 at 10:27 AM Greg KH wrote: > > On Tue, Oct 01, 2019 at 10:09:46AM -0600, Mat King wrote: > > Resending in plain text mode > > > > I have been looking into adding Linux support for electronic privacy > > screens which is a feature on some new laptops which is built into the > > display and allows users to turn it on instead of needing to use a > > physical privacy filter. In discussions with my colleagues the idea of > > using either /sys/class/backlight or /sys/class/leds but this new > > feature does not seem to quite fit into either of those classes. > > > > I am proposing adding a class called "privacy_screen" to interface > > with these devices. The initial API would be simple just a single > > property called "privacy_state" which when set to 1 would mean that > > privacy is enabled and 0 when privacy is disabled. > > > > Current known use cases will use ACPI _DSM in order to interface with > > the privacy screens, but this class would allow device driver authors > > to use other interfaces as well. > > > > Example: > > > > # get privacy screen state > > cat /sys/class/privacy_screen/cros_privacy/privacy_state # 1: privacy > > enabled 0: privacy disabled > > > > # set privacy enabled > > echo 1 > /sys/class/privacy_screen/cros_privacy/privacy_state > > What is "cros_privacy" here? This would be set by the device driver. This example would be for a Chrome OS privacy screen device, but the driver would set the name just like in the backlight class. > > > Does this approach seem to be reasonable? > > Seems sane to me, do you have any code that implements this so we can > see it? It is still early in the implementation so there is no code quite yet. I wanted to get some general feedback on the approach first. As soon as I have code to share I will post it. > > thanks, > > greg k-h Thank you for the feedback.