From patchwork Sun May 21 22:58:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Rojek X-Patchwork-Id: 9642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1093545vqo; Sun, 21 May 2023 16:07:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vVotaoAFAPrJk+cbK60we6GyjUl/pGkV+pm7gacSGC+ye5LH8mtA3lf5eLGlm+8q0lKOX X-Received: by 2002:a05:6a20:c791:b0:106:25b3:2f92 with SMTP id hk17-20020a056a20c79100b0010625b32f92mr8575909pzb.52.1684710447782; Sun, 21 May 2023 16:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684710447; cv=none; d=google.com; s=arc-20160816; b=uXadoQdxeTO11s6LbQLJ603zBveCjf2p+34G8LEAW2n/ITsad83AGuqw9gTTEkBRIU zXxugnMkQBpj1gJjTFgbsurH+Zr/QIlTjKOrJ/rTbqm5lIG9240yJgwhLSQm/ClBFHFa JpboSNDbcjeGRGqtcNM4Elza7IDnf9vUU0shfpq6pyXygavjeJh17Xy2bKj3pSDZXqHy nGsFiKEVGOGz1Zw+EOOl/gT4HOZuNy0yvhK10UOStyLiNA5PA2DqOTBilz7O+EfKmv93 IklarLiQzMlihf9oflwHbZzTQQbIqXG24qlYiIfEVGuBv22YhdrWn60vWvD2quOFRalK MRaw== 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 :message-id:date:subject:cc:to:from; bh=+dQ8Gu/7adhVTNEmUTOpR5FAdalBhCD39oHOXDmyG4Y=; b=N5Sk7YcPfW1+KwwSe8IZ2pwrAMGxKr/qBqRtDugqo27ChMLa4+eNdToroAZMDvFcJE FlVodfO/mVvbD9bMGtHv1GxJTONgNuU5E4/9CznMOnI9sz9E1NqPtg5rkDEUPo5LAdgg V8/KN41Qm2NoHRBoA+g4YVki+6TcnK0UeNIGnHeJq51rdsSE0keLzYEbu3gG1nsOVF+p liRX+QF30fZPPgRUPaO/c9oM5MvB6g9HcBqUU9COBAX36/qDGt6dL3n4JFPZLFDegdGH KT3murp8d7NEG+eBZo7+qnWAEwGZyJiGK4bKXwhCfVevtO84gUyLdwYcbygT2Jdz0w8o NpPA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u203-20020a6279d4000000b0063b5f25dd95si3674736pfc.391.2023.05.21.16.07.16; Sun, 21 May 2023 16:07:27 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231539AbjEUW76 (ORCPT + 99 others); Sun, 21 May 2023 18:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231150AbjEUW7u (ORCPT ); Sun, 21 May 2023 18:59:50 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3C74BF; Sun, 21 May 2023 15:59:46 -0700 (PDT) Received: (Authenticated sender: contact@artur-rojek.eu) by mail.gandi.net (Postfix) with ESMTPSA id 86FB91C0002; Sun, 21 May 2023 22:59:43 +0000 (UTC) From: Artur Rojek To: Paul Cercueil , Jonathan Cameron , Dmitry Torokhov , Chris Morgan , Andy Shevchenko Cc: linux-mips@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Artur Rojek Subject: [PATCH v2 0/2] iio/adc-joystick: buffer data parsing fixes Date: Mon, 22 May 2023 00:58:59 +0200 Message-Id: <20230521225901.388455-1-contact@artur-rojek.eu> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1766546942364902519?= X-GMAIL-MSGID: =?utf-8?q?1766546942364902519?= Hi all, this is a long overdue v2 for fixes [1] related to adc-joystick channel parsing. Patch [1/2] now also addresses a case where a readout of ADC data containing samples for two channels, where only one channel is active, would push the data into a buffer without discarding the disabled channel first. Patch [2/2] addresses concerns about exposure to channels the clients shouldn't know about. The IIO helpers from v1 are gone and the offsets are now calculated based only on the channels adc-joystick has access to. Tested on GCW Zero (by me) and on Anbernic RG350 (by Paul). [1] https://lore.kernel.org/all/20220817105643.95710-1-contact@artur-rojek.eu/ Cheers, Artur Artur Rojek (2): iio/adc: ingenic: Fix channel offsets in buffer input: joystick: Fix buffer data parsing drivers/iio/adc/ingenic-adc.c | 20 +++-- drivers/input/joystick/adc-joystick.c | 102 +++++++++++++++++++++++--- 2 files changed, 103 insertions(+), 19 deletions(-)