From patchwork Sat Nov 5 22:34:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yauhen Kharuzhy X-Patchwork-Id: 622496 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDDFBC4332F for ; Sat, 5 Nov 2022 22:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbiKEWe4 (ORCPT ); Sat, 5 Nov 2022 18:34:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbiKEWe4 (ORCPT ); Sat, 5 Nov 2022 18:34:56 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ED9B11154; Sat, 5 Nov 2022 15:34:54 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id h12so11098835ljg.9; Sat, 05 Nov 2022 15:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6CtIVQWP+Kxh/6X4LVIIdMYVxRHCgpX/NmfsfTqOY7k=; b=UIPJcAD9s4TdNFm9zVg2P/mZ0ZQlI3XcjxuMV21bO0DdBw8M8wwStfipvihaD7rtzP wPxH4DYR2D+cPmO8gtC7VZWSws0s4qrsYx+bX7Ae0OGPG/FsKehC2JrCAxN18j6W7ruK We3u1M3asut7zASyfQQCdHGSXNFekALPKrkk4xcxxJU55Tazs+Do521YzUXAUyejbTCZ 6AGybtRgYLe4i/iftNdP6mWQZweqeuDvOy9nYjHLsGg2vBBqhAyaXRlN+R1TxEDGcVGN lYTukvEUbEfVVwrzJyk7Mr8kPoazydoMbe0/zf19ZWVlZH5YleOzwwZ8SusyMZCh2dNV tMUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6CtIVQWP+Kxh/6X4LVIIdMYVxRHCgpX/NmfsfTqOY7k=; b=B59rtbnHfX/BhoRjMhBqWt3pK4q5/6nx0jEtAsap8hrCuRE6kbBpAcBP5nLpAUPU1H 1kHYQ3xzOlHuzMtv2OWWeJ1wbIYsIWrBd64xrS2l7Ku7F/qpgWUdEeDE2Zh6BV26PLdb Xb4ctxf0NPvvvNt5xwPF98e1GjPtgejlS38a+FpHFYGWJVLx/14jfBaqs+SNCBbjQ6T1 Jzqief3SRJURQYk/IJsKAd+NZD3scfNGNuoamJo23nizIv5170Apo+ydeDHAFNRXvNfV 3iUefPQ8Go9EvOvwLzF+/XZ0ME+rEXMrgUZX0xxacBiVrHR6vRb9jtghScwrr/IgSi89 kAjw== X-Gm-Message-State: ACrzQf0XVMBE1MTooZXnJK9dGvIAp3/vcuNlHcpbIhdM488kCyAjVSNp 2VnVwJuMdxDlQpjALsoUg9cWqwJ4xyg= X-Google-Smtp-Source: AMsMyM6BXFpVv8PLWvJZIV2gTYX18Gxsz76ZzOnmTC4d4zkF5p/PE4dhpWDIvZ9P4Zm3JHlPuMbMag== X-Received: by 2002:a2e:94cf:0:b0:26c:5d14:6ec7 with SMTP id r15-20020a2e94cf000000b0026c5d146ec7mr16455809ljh.237.1667687692019; Sat, 05 Nov 2022 15:34:52 -0700 (PDT) Received: from localhost.localdomain (cl-78-158-27-188.fastlink.lt. [78.158.27.188]) by smtp.gmail.com with ESMTPSA id a5-20020ac25e65000000b0049a5a59aa68sm447889lfr.10.2022.11.05.15.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Nov 2022 15:34:50 -0700 (PDT) Received: from jek by localhost.localdomain with local (Exim 4.96) (envelope-from ) id 1orRkX-001kZF-2v; Sun, 06 Nov 2022 00:34:49 +0200 From: Yauhen Kharuzhy To: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Benjamin Tissoires , Srinivas Pandruvada , Jonathan Cameron , Jiri Kosina , Yauhen Kharuzhy Subject: [PATCH] HID: hid-sensor-custom: Allow more than one hinge angle sensor Date: Sun, 6 Nov 2022 00:34:22 +0200 Message-Id: <20221105223422.417316-1-jekhor@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Some devices has two sets of accelerometers and the sensor hub exports two hinge angle 'sensors' based on accelerometer values. To allow more than one sensor of the same type, use PLATFORM_DEVID_AUTO instead of PLATFORM_DEVID_NONE when registering platform device for it. Checked on the Lenovo Yoga Book YB1-X91L tablet. Signed-off-by: Yauhen Kharuzhy Reviewed-by: Jonathan Cameron Acked-by: Srinivas Pandruvada --- drivers/hid/hid-sensor-custom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c index 32c2306e240d6..a6fc89ee1287c 100644 --- a/drivers/hid/hid-sensor-custom.c +++ b/drivers/hid/hid-sensor-custom.c @@ -862,7 +862,7 @@ hid_sensor_register_platform_device(struct platform_device *pdev, return ERR_PTR(-ENOMEM); custom_pdev = platform_device_register_data(pdev->dev.parent, dev_name, - PLATFORM_DEVID_NONE, hsdev, + PLATFORM_DEVID_AUTO, hsdev, sizeof(*hsdev)); kfree(dev_name); return custom_pdev;