Received: by 10.223.185.116 with SMTP id b49csp2143485wrg; Sat, 17 Feb 2018 13:20:01 -0800 (PST) X-Google-Smtp-Source: AH8x225iSmAE2m85FC6AfY3SMv7Hst4290LKWNVzebX2fHd9L+06GxSRYY9QIIgQ/zEJ2JU0d1m7 X-Received: by 2002:a17:902:2c43:: with SMTP id m61-v6mr9783401plb.387.1518902401365; Sat, 17 Feb 2018 13:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518902401; cv=none; d=google.com; s=arc-20160816; b=xmkIj9+mNqoGdA6K5HE1KvYzDbt/nvu+50FACBkCGOybSfHVGxEtcMQwp5xefK34HC gF0ACYBydYd40uIYVRKwxSTK0yZ91Wa049n7YTZfgmmQ0ea6AP+t4kq5AtcX4+vkvgBB SCx/MaBtphMRNseG642msFUkyGZ3U39LvFubBdv56nJpqJXmRUklnR/KpP8ihZNCq/3y Sq59tpCou+Z9vNd/ZvmwMy3nxc5L5fEKsZeKihb6FNDcoFh3pMgFYJcVc2vPhjt9dS3e dUtJa3VCEh+OQqjKvK1fbF0l3xdjJ8/hBsZT8bqkLYhlDUP/iU7uY0oou+X/K8SncIgc Cp0A== 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=uUlXMH4lCvVtF/1340DimeIYWyRzRv491FZ7H4mO2PQ=; b=di7KelHyoznl4NnWAGI4BU1K3khyRDTV/jXMxMHX8qKN/gnZDUP7cjppWCBNlKBUNv q4ito2CRlaIuttTa5GOkeMOYPOV3x2lMuHmLmszaP3/thFGh46iC8pNUiz75t7ikhq8n gR6Pp0cZ5ruwbCHuz08f74iwgOsXoXFhQa7U7xlKyBSXePypmICU5Ts9onT6Mr2BXMjl Ri0ry7lyrCy/ZjTY7/V8wG42A/XSpLdD5S5Mzi32jU9N5kG9plcH/YLtV9sK+WO+J3cW HLaqz13sYdtClTLAhs1l8WqakGzSmAtGkhsei/B/ua9pGoWRXAWG2boiYM2F92x9EwzI 3TSw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b185si3290834pgc.608.2018.02.17.13.19.47; Sat, 17 Feb 2018 13:20:01 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751442AbeBQVTI (ORCPT + 99 others); Sat, 17 Feb 2018 16:19:08 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:57931 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751262AbeBQVTG (ORCPT ); Sat, 17 Feb 2018 16:19:06 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 3D79680182; Sat, 17 Feb 2018 22:19:05 +0100 (CET) Date: Sat, 17 Feb 2018 22:19:14 +0100 From: Pavel Machek To: Peter Hutterer Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , Bastien Nocera , Dmitry Torokhov , Ivaylo Dimitrov , Sebastian Reichel , Mauro Carvalho Chehab , Chuck Ebbert , Henrik Rydberg , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] input: Add disable sysfs entry for every input device Message-ID: <20180217211914.GB9640@amd> References: <1482660296-8432-1-git-send-email-pali.rohar@gmail.com> <1483370825.2420.8.camel@hadess.net> <201701021809.58943@pali> <1483442481.2420.12.camel@hadess.net> <60c21c4d-bb81-342a-45e1-7e92313e05d7@gmail.com> <1483540655.2420.18.camel@hadess.net> <20180102215437.i3x2j6jvxtac4ntt@pali> <1514944049.2523.28.camel@hadess.net> <20180103093133.u7wszegjk2msxryl@pali> <20180109020424.GC29886@jelly> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline In-Reply-To: <20180109020424.GC29886@jelly> 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 --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > > So, do you mean to implement this "disable" action as ioctl for > > > > particular /dev/input/event* device (instead of sysfs entry)? > > >=20 > > > Yes, so the device can be powered down without the device node being > > > closed and made unavailable. I don't know whether that's something > > > that's already possible for all cases, but there's already > > > opportunistic in a lot of drivers and subsystems. > > >=20 > > > This opens up a whole new wave of potential problems, but it's a more > > > generally useful mechanism, I would think. > >=20 > > Ok. How should API for this ioctl looks like? And do you have an idea > > for name of that ioctl? > >=20 > > Dmitry, what do you think about it? It is acceptable for you? >=20 > first: sysfs files are pretty terrible because writing to them requires r= oot > and we don't have the benefit of logind. so for any sysfs toggle expect > a nicely integrated userspace solution to be less than optimal. Well, you can chmod / chown sysfs files. > besides: 99% of the above is figuring out the policy *when* to disable the > device. disabling it is trivial by just closing the evdev nodes and tbh I > don't think we (in userspace) should care about whether the device is > powered down or now, it should be the default assumption that it is power= ed > down when not in use. >=20 > for the cases where you must keep the device open but you don't want even= ts,=20 > EVIOCSMASK is likely the best solution. improving the kernel so it powers > down the device when the mask excludes all events (and there are no other > listeners) could be an interesting task. But yes, that sounds like an idea. BTW in the meantime, someone added this to pmos wiki... this should solve some of my problems. Best regards, Pavel FILE=3D~/.screenoff if [ -f $FILE ]; then xinput set-prop 8 "Device Enabled" 1 xinput set-prop 6 "Device Enabled" 1 xinput set-prop 9 "Device Enabled" 1 xset dpms force on rm ~/.screenoff else xinput set-prop 8 "Device Enabled" 0 xinput set-prop 6 "Device Enabled" 0 xinput set-prop 9 "Device Enabled" 0 xset dpms force off touch ~/.screenoff fi =09 =20 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --ZfOjI3PrQbgiZnxM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlqInFIACgkQMOfwapXb+vL/awCfZnFF2Msqonv7wV4aJYaJaADM jfUAnilWGYTRsXLO3vwGbdY4aUW3uUw4 =JgLb -----END PGP SIGNATURE----- --ZfOjI3PrQbgiZnxM--