Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1724641ybv; Fri, 14 Feb 2020 05:01:30 -0800 (PST) X-Google-Smtp-Source: APXvYqxgo/+xblWcHk7dve+fOu4p0KvXLDzRj2qfFdQeOHg8pi500OWh7Nu3I2RehOOMHy86kOWW X-Received: by 2002:aca:1b17:: with SMTP id b23mr1771308oib.95.1581685289861; Fri, 14 Feb 2020 05:01:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581685289; cv=none; d=google.com; s=arc-20160816; b=X+dMBIz0/uvrKaj6ODB/gXYzGfz2sIHBurB6R5J0GTmpbEC346S4uGTGk4DWgy/0Yl mUVmemXF6x6aL3fl9enirlIgAoErEmyjyFuc7IBYQhqM51V934CaD/ypsQSEifqGKU9J 5GK3jZrK3KtFbc6SQUOWCz9ioPlHIRKKnGiaFTdxxT2EvE+lAuH8ESQkKMDVVU0eLxbI RlSKVCDTlgcAiveqp0/8VhkdwvId258TUQ0NvQcX45nG91EDcNheZg5y5zQX/0vtl9ON gUU5UjFpLEnvD69fUh6V5Xle6XBPAIyFGTVlMC810jE18nz+anYLaJlJ0zBulwVHxtxC rUzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Q9PRBzzMe+a3dzAzMxrx0xT2y1fZevZ8aQZ/OjHoBN8=; b=AMvCn+fw90BWKy0wUAQs5EAsfgvnTa+UHIpWRZuMilKmASj3A/vQSmhxJ9gwgM94N2 zhR9JotWEgqe7anHvrdgoXJCngjwn61TRFdyRM7QXH/IajEJ0gra2Y2fhHfwfCjpUjXf rL/6BzcXKINdd8geRUCiGCBkRzIs3uLIRIArl55DMs0xLDp4ouVNgMiy2qqWaoyKRTzS 68eZcTUs2mI/23tRNc/HnmxlPY8ZDmqG50VPtzOZn5bHzuGMxf4TLuvNKwKWQU0Wuy2X W1fP4U3FRgX5P8qJ33ku6Q3QqI23ULmMUwfg68TlN2+2Etc6Fj268ewCX62zVkSpwd3x uGkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wizzup.org header.s=mail header.b=J+8f2YqS; 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=QUARANTINE dis=NONE) header.from=wizzup.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si2906520oic.245.2020.02.14.05.01.16; Fri, 14 Feb 2020 05:01:29 -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; dkim=fail header.i=@wizzup.org header.s=mail header.b=J+8f2YqS; 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=QUARANTINE dis=NONE) header.from=wizzup.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729242AbgBNNBH (ORCPT + 99 others); Fri, 14 Feb 2020 08:01:07 -0500 Received: from a80-127-99-228.adsl.xs4all.nl ([80.127.99.228]:59454 "EHLO hetgrotebos.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727970AbgBNNBD (ORCPT ); Fri, 14 Feb 2020 08:01:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=wizzup.org; s=mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Q9PRBzzMe+a3dzAzMxrx0xT2y1fZevZ8aQZ/OjHoBN8=; b=J+8f2YqS5b9SXJ+ctf75ziQntm IDqPGFfoH6VLBLfEb78RBz7itd9w+j6Doe5sUOpKFvlB/Ir38fY7Y125Nrrk8maCGT1xGRphJXyOT Ka6W94g+va9bmC0V9S+PajK41qIUQjnVm08bAsXDlA/AfuJTlN5a4zCPhbaWGmW4W+VcTRgOsQm7j JLo7t4JTOVZhLpHe16q+E6O6M6fwYsEc2CJtLbWqsXWI2SgZhqVTaYTzTjHJRVCRuolNLpcNbpRjq KaGBvOF7t6dbOgAZmkZsFeM9kQOXOOze0iTpOD+fs28Tin+gMPGNfwRM2i/PdRf9UNaGcyo9VTKcM oA9d1m7Q==; Received: from kgpe-d16.fritz.box ([192.168.178.22]) by hetgrotebos.org with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1j2aaS-0002df-Ny; Fri, 14 Feb 2020 13:00:52 +0000 From: Merlijn Wajer To: merlijn@wizzup.org Cc: =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Tony Lindgren , Rob Herring , Mark Rutland , Dmitry Torokhov , Mattias Jacobsson <2pi@mok.nu>, "Darren Hart (VMware)" , linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [RFC PATCH 0/2] Add SW_MACHINE_COVER key Date: Fri, 14 Feb 2020 14:02:46 +0100 Message-Id: <20200214130249.6845-1-merlijn@wizzup.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds the SW_MACHINE_COVER key, and changes the Nokia N900 dts to expose the key via gpio-keys. Before, this gpio was used as card detect GPIO, causing the card not to show up if the phone was booted without cover, see this thread on linux-omap: N900: Remove mmc1 "safety feature"? (was: Re: mmc0 on Nokia N900 on Linux 5.4.18) Since there is no realistic use for using this gpio as card detect, instead expose it to userspace via gpio-keys. There are no event type for machine covers yet, so add that first. The key should be 1 when the cover is closed, and 0 when the cover is open. Starting the Nokia N900 with the cover removed, putting the cover in place: Event: time 1581684523.415296, type 5 (EV_SW), code 16 (?), value 1 Removing the cover again, exposing mmc1 and the battery: Event: time 1581684529.413706, type 5 (EV_SW), code 16 (?), value 0 Merlijn Wajer (2): Input: add `SW_MACHINE_COVER` ARM: dts: n900: remove mmc1 card detect gpio arch/arm/boot/dts/omap3-n900.dts | 12 ++++++++---- include/linux/mod_devicetable.h | 2 +- include/uapi/linux/input-event-codes.h | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) -- 2.23.0