From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E807EC433E9 for ; Thu, 11 Mar 2021 09:56:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA34C64E0F for ; Thu, 11 Mar 2021 09:56:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232149AbhCKJ4M (ORCPT ); Thu, 11 Mar 2021 04:56:12 -0500 Received: from mx1.opensynergy.com ([217.66.60.4]:1347 "EHLO mx1.opensynergy.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232100AbhCKJ4A (ORCPT ); Thu, 11 Mar 2021 04:56:00 -0500 Received: from SR-MAILGATE-02.opensynergy.com (localhost.localdomain [127.0.0.1]) by mx1.opensynergy.com (Proxmox) with ESMTP id 660EAA18F1; Thu, 11 Mar 2021 10:55:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=opensynergy.com; h=cc:cc:content-transfer-encoding:content-type:content-type :date:from:from:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=srmailgate02; bh=Hho8sCwHXdiv Va2f3D+zupd7uEjiXNvLZSh9/qyBmO0=; b=TghzjHDRrKjPK7/DJ9d36apunlbL SWLTPM3WW+OopkXH1LOQN0IV7NHXxwKEyw+hgmseqeUEZOGdH3kY5tG+ohrT39eo ONiIfpxKo7reki2cp4IkYsXwfWOoDPPzH3sh+LB1peBRC0HDakbtzSD1rN9qfYNI bNpz8tTTrrdOMd/5DYk+umYP8vnSQ2z/E/ioxp219k5pmoECV2Z7H8+uS2ojdjjd w2MlCPZQCJCGxmeSD+f+iv09AWjT/gWHHPA1DbpvJGiGPMHpfAX66o1tOCGHRzzD b0m6QZfhakbQHDXtW9kM90jktU9q0pU/BIg5nnv61/QVyNRf7Q1q5ruDOw== To: Jyoti Bhayana CC: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Lukas Bulwahn , , , Cristian Marussi , Sudeep Holla , Enrico Granata , Mikhail Golubev , Igor Skalkin , Ankit Arora , Guru Nagarajan , kernel test robot , Jonathan Cameron References: <20210309231259.78050-1-jbhayana@google.com> <20210309231259.78050-2-jbhayana@google.com> <0b9483ca-6f61-cc13-34e6-7f8c31c4c626@opensynergy.com> From: Peter Hilber Subject: Re: [PATCH v7 1/1] iio/scmi: Adding support for IIO SCMI Based Sensors Message-ID: <695b1680-9e5a-89bd-bd3b-e794200587dc@opensynergy.com> Date: Thu, 11 Mar 2021 10:55:48 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SR-MAIL-01.open-synergy.com (10.26.10.21) To SR-MAIL-02.open-synergy.com (10.26.10.22) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10.03.21 18:19, Jyoti Bhayana wrote: > Hi Peter, > > As already discussed with ARM, the spec clearly mentions that it has > to be uppercase and not case insensitive. So this patch is consistent > with the specs and changing it with means that the spec would need to > change as well. Therefore, there is no need for another version of the > patch > > "A NULL terminated UTF-8 format string with the sensor axis name, of > up to 16 bytes. It is recommended that the name ends with ‘_’ followed > by the axis of the sensor in uppercase. > For example, the name for the x-axis of a triaxial accelerometer could > be “acc_X” or “_X" > My understanding of the part of the spec quoted above is different: The spec only makes a recommendation and does allow additional or even contradictory sensor axis naming schemes. So the change to the implementation only would in principle be possible (disregarding integration timeline constraints). Best regards, Peter > Thanks, > Jyoti > > On Wed, Mar 10, 2021 at 3:16 AM Peter Hilber > wrote: >> >> On 10.03.21 00:12, Jyoti Bhayana wrote: >>> This change provides ARM SCMI Protocol based IIO device. >>> This driver provides support for Accelerometer and Gyroscope using >>> SCMI Sensor Protocol extensions added in the SCMIv3.0 ARM specification >>> >> >> [snip] >> >>> + >>> +static int scmi_iio_get_chan_modifier(const char *name, >>> + enum iio_modifier *modifier) >>> +{ >>> + char *pch, mod; >>> + >>> + if (!name) >>> + return -EINVAL; >>> + >>> + pch = strrchr(name, '_'); >>> + if (!pch) >>> + return -EINVAL; >>> + >>> + mod = *(pch + 1); >>> + switch (mod) { >>> + case 'X': >>> + *modifier = IIO_MOD_X; >>> + return 0; >>> + case 'Y': >>> + *modifier = IIO_MOD_Y; >>> + return 0; >>> + case 'Z': >>> + *modifier = IIO_MOD_Z; >>> + return 0; >>> + default: >>> + return -EINVAL; >>> + } >>> +} >>> + >> >> Hi Jyoti, >> >> could you still change the above code to also accept lower case 'x', >> 'y', 'z'? >> >> Supporting lower case as well would establish compatibility with the >> lower case naming conventions used for IIO channels. By this change, >> channels could be forwarded without name changes (as long as they fit >> into the name field). I'm sorry to notice this only now. >> >> Best regards, >> >> Peter >> >