From patchwork Wed Feb 22 00:10:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 60292 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp296053wrd; Tue, 21 Feb 2023 16:17:26 -0800 (PST) X-Google-Smtp-Source: AK7set8unQflQrVmRqvf8TW5YedqWrqOVA3fjPum4yMt98wVpXz8vJfdqd8NCMkOmOjJbd2H4r3B X-Received: by 2002:a17:90a:df16:b0:236:764e:6573 with SMTP id gp22-20020a17090adf1600b00236764e6573mr6779667pjb.26.1677025045533; Tue, 21 Feb 2023 16:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677025045; cv=none; d=google.com; s=arc-20160816; b=UvTM5exgyzOMgB9jRRtNz/e8ApCPKIW7L0nyoxocYbWeShn8naMxlrAGkcs353aRwV 7h5jtfeLQBusUnus2fbUVfQQrcAuHm1pXiEEWVNoHcN6HFMJ1YMZ5z9Kaj4SuhswxSNm Ntrr//heQRyfE9pomDWARDoVaCtzW/88bvqDcKRAYvF3vEAMZJeXNEfcZpMg9oKigirr upc8GKG1+ntXgfBAoIan1GwfA/ZPRqgc5LffQSuP+pbqLVFjlHYtm1+rizeN0Qdx7a4I rtxToBg/v6rvxm+ix1taoGCQXRVVa5cggNVPGJf6WJ+4P1scTkBPWsiDnKffhT6S0Ghl Wt/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/QXuNWin/tGJInumVzQRSdFMsgryJCGrUDywwf28ZUA=; b=JlKnzOemhL4iomAt4410grBL8lyVTV72fZmbxqAbEC7MjrcEFc+ukf/dNN473vJxjO QKYQqdzSlM/CxPZSNadX7Jdo3hYHOpMmdZ7iR69QH7UBZcobdgF4gbyUc6Di67uaud04 cT/NbAaGpPegI/GRDbhQrqv56pmaq/4/xRd9uAotcFxBKzfqOAiN0KLO9+uYPYc3kIs+ MAUGvEpbnmthWnIJROu6Dzo/vqFPM2AkzE4ER48SsGOIE5LPQJ+RWIimvhF/6hCwoMDY m2RxW/wpVPSRWSOs/Tsb1DvpTedEZulSrWOyoxhbF0f8qwFUV4bKokQAhAR6X4LnAJvs V7Zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a17090a404c00b002369d345a72si13222274pjg.161.2023.02.21.16.17.12; Tue, 21 Feb 2023 16:17:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbjBVALy (ORCPT + 99 others); Tue, 21 Feb 2023 19:11:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbjBVALw (ORCPT ); Tue, 21 Feb 2023 19:11:52 -0500 Received: from irl.hu (irl.hu [95.85.9.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17F6D2A6EA; Tue, 21 Feb 2023 16:11:49 -0800 (PST) Received: from fedori.lan (bc065635.dsl.pool.telekom.hu [::ffff:188.6.86.53]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 000000000006FA8C.0000000063F55DC3.002C9F6F; Wed, 22 Feb 2023 01:11:46 +0100 From: Gergo Koteles To: Dmitry Torokhov , Jonathan Corbet , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Caleb Connolly , Gergo Koteles Subject: [PATCH v4 2/3] Input: add ABS_SND_PROFILE Date: Wed, 22 Feb 2023 01:10:33 +0100 Message-Id: <1a4752739568afbdbaaff48436d2bb595d2bda0d.1677022414.git.soyer@irl.hu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: Mime-Version: 1.0 X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758488214151892876?= X-GMAIL-MSGID: =?utf-8?q?1758488214151892876?= ABS_SND_PROFILE used to describe the state of a multi-value sound profile switch. This will be used for the alert-slider on OnePlus phones or other phones. Profile values added as SND_PROFLE_(SILENT|VIBRATE|RING) identifiers to input-event-codes.h so they can be used from DTS. Signed-off-by: Gergo Koteles --- Documentation/input/event-codes.rst | 6 ++++++ drivers/hid/hid-debug.c | 1 + include/uapi/linux/input-event-codes.h | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/Documentation/input/event-codes.rst b/Documentation/input/event-codes.rst index b4557462edd7..d43336e64d6a 100644 --- a/Documentation/input/event-codes.rst +++ b/Documentation/input/event-codes.rst @@ -241,6 +241,12 @@ A few EV_ABS codes have special meanings: emitted only when the selected profile changes, indicating the newly selected profile value. +* ABS_SND_PROFILE: + + - Used to describe the state of a multi-value sound profile switch. + An event is emitted only when the selected profile changes, + indicating the newly selected profile value. + * ABS_MT_: - Used to describe multitouch input events. Please see diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index e213bdde543a..76fb2ecbbc51 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -1018,6 +1018,7 @@ static const char *absolutes[ABS_CNT] = { [ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt", [ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "ToolWidth", [ABS_VOLUME] = "Volume", [ABS_PROFILE] = "Profile", + [ABS_SND_PROFILE] = "SoundProfile", [ABS_MISC] = "Misc", [ABS_MT_TOUCH_MAJOR] = "MTMajor", [ABS_MT_TOUCH_MINOR] = "MTMinor", diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 022a520e31fc..e8d5ee027b40 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -866,6 +866,7 @@ #define ABS_VOLUME 0x20 #define ABS_PROFILE 0x21 +#define ABS_SND_PROFILE 0x22 #define ABS_MISC 0x28 @@ -974,4 +975,12 @@ #define SND_MAX 0x07 #define SND_CNT (SND_MAX+1) +/* + * ABS_SND_PROFILE values + */ + +#define SND_PROFILE_SILENT 0x00 +#define SND_PROFILE_VIBRATE 0x01 +#define SND_PROFILE_RING 0x02 + #endif