Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3512186yba; Mon, 8 Apr 2019 21:59:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnmR9RqK3Iovd8mx1GJctR3uKeeVL9qcCJFhN6BtE1FveI7G58Pc7uUWuMqpOTpv7siFj8 X-Received: by 2002:a65:43c3:: with SMTP id n3mr33284855pgp.375.1554785995995; Mon, 08 Apr 2019 21:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554785995; cv=none; d=google.com; s=arc-20160816; b=zi9H+Kg4NyFxu+Ew/+oijVPgpCOdH8zuIRByzOGgxl880SiQo7HQFVD4k5bkdwqo/z VdNyCAFvzVeV5zGob/aEe16xiMYwQ0YnMVH2B3OUDU32r8aQM7HH/uTEnfkg3IKPj8Yv nSpE77fCu9BaycVJCPgSQ1bMeITJ7RB9EW/p0VAOnH1qgfNtArTZzoUuSRxtVT26Y1Or E2drCeDExWrXfosqa7Dyeo9lhZXeMNLxLWMhnh48D1v3J70WJnCPJrZ+xoA6YQ2zilf+ JZNXN33Rw30q5h/9X1Nr6uqeq8rVuM5/FHV70Tp2VXxihWjpL2rfd09GsKI59sd7PcpR 7tyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fSbzNkjsSwkHQttu+TEGQLmXcM0+AN4d0v8/VJDirT0=; b=Qnz+ceV2sLC93uazv9L+KQMhZvoCrpjW+Qm8BKHP9j70ljR3wEDMEW4mBCyKTmWATd ctVu53cDmyAdj9FTQ0icc0w/1vakC53kTRe47oz7Ixd28HzrP552cV+tO5wTWEfRwxtF mBKIxL9AQw2y8nPrALlQaJmVubsI+O0pV2bDEwY7Vnlh5tdmAhnWKJRlNAh4St847WeN 1Rut3qKHv8ZAvD+rfMVF+1AXnoVygZFhO3HVqAqOsWcHJ43sVUOw2zAtOTkDh1nVHMjs MpHDY4I1Df4cr8a22wV2LDlJaQJxlgVGnF7QYmLXbI3YVI/cTgnvf/3m5YDGgWlFbqii Fnvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Culiuvlb; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si5487172plo.394.2019.04.08.21.59.40; Mon, 08 Apr 2019 21:59:55 -0700 (PDT) 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=pass header.i=@gmail.com header.s=20161025 header.b=Culiuvlb; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbfDIE4l (ORCPT + 99 others); Tue, 9 Apr 2019 00:56:41 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37100 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725550AbfDIE4l (ORCPT ); Tue, 9 Apr 2019 00:56:41 -0400 Received: by mail-pg1-f195.google.com with SMTP id e6so8577714pgc.4; Mon, 08 Apr 2019 21:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fSbzNkjsSwkHQttu+TEGQLmXcM0+AN4d0v8/VJDirT0=; b=Culiuvlbppghdx3mpcnmXq4pzQXD5BxfSCgJKFEUMLy2pfANurqs3aMveGuAU+//Sd C+HkR2TId1a65C+Bo6ktfpH6qtezABxMeWdi3IU4yxdHOMX7CRbwtNVqVQtGFydqlqY7 J4tA52veE1Z4EaI+8fPOA13dAMVMWacUydP6vlOr0ZFcaDJgDFjZQYFNCevaLZ6D62A/ tA3Ifbn7eRJHLljSTd4MnV015V0Y+o5bLCLfTqzo4ObooBELVzIPxaTivrRIsWe3PSQu 29mm7qT0SQn+xhx4bh4fKQ48FF7Z9PTbrFcfy9kHalvV2kkQOxpVOSB1se0uqwyjeovy lNQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fSbzNkjsSwkHQttu+TEGQLmXcM0+AN4d0v8/VJDirT0=; b=uci5mu2fvUufliuqobiWXh3FpXXPGRlwMl5aTikXqQY8Lem9erOFWd35UdNozcNkxl Fa1VUAr6DPt9znLTUZ9t76aCO2qehwRtJsbEOY6aPKH8vt5N0+bWZakw+6oCGo0GiQST d3Ki79jJFbmdGOdhrNJLNLV2rbLx24Vrc3A0YsL98+SKjw3+RHjH1RoKdJGn/EjL/BiC Mv5b/CCosO0dTQ0+KRe9YAEw0fRXCGiDjhazeCrFhiutdZqVqrbU+dBwJn5qrYvLmswm JOTAWj7GKhp00LUHFgK7Kgjxav6mUO5c0e+kdvQVT/BjpL2M9yojmuuws7xl1xa0xWOx xJmg== X-Gm-Message-State: APjAAAU2lmA/PIMst0FZWAfliPCKPd76dCtzw7M3l6fs4rBDRRjASBtJ o5zWezuKDm2jmoEWTXo2UbI= X-Received: by 2002:a63:195e:: with SMTP id 30mr32256554pgz.312.1554785800471; Mon, 08 Apr 2019 21:56:40 -0700 (PDT) Received: from icarus ([2001:268:c1c0:11e:c70:4af9:86e2:2]) by smtp.gmail.com with ESMTPSA id c189sm48847177pfg.24.2019.04.08.21.56.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Apr 2019 21:56:39 -0700 (PDT) Date: Tue, 9 Apr 2019 13:57:28 +0900 From: William Breathitt Gray To: Pavel Machek Cc: gregkh@linuxfoundation.org, jic23@kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, fabrice.gasnier@st.com, benjamin.gaignard@st.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, akpm@linux-foundation.org, david@lechnology.com, robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, leoyang.li@nxp.com, daniel.lezcano@linaro.org, tglx@linutronix.de, thierry.reding@gmail.com, esben@haabendal.dk, linux-pwm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, patrick.havelange@essensium.com, Jonathan Cameron Subject: Re: [PATCH v10 01/18] counter: Introduce the Generic Counter interface Message-ID: <20190409045728.GA2842@icarus> References: <20190408215515.GA27592@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190408215515.GA27592@amd> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 08, 2019 at 11:55:15PM +0200, Pavel Machek wrote: > Hi! > > > +const char *const counter_count_direction_str[2] = { > > + [COUNTER_COUNT_DIRECTION_FORWARD] = "forward", > > + [COUNTER_COUNT_DIRECTION_BACKWARD] = "backward" > > +}; > > +EXPORT_SYMBOL_GPL(counter_count_direction_str); > > + > > +const char *const counter_count_mode_str[4] = { > > + [COUNTER_COUNT_MODE_NORMAL] = "normal", > > + [COUNTER_COUNT_MODE_RANGE_LIMIT] = "range limit", > > + [COUNTER_COUNT_MODE_NON_RECYCLE] = "non-recycle", > > + [COUNTER_COUNT_MODE_MODULO_N] = "modulo-n" > > +}; > > +EXPORT_SYMBOL_GPL(counter_count_mode_str); > > Dunno. Exporting const tables saying "forward" and "backward". Can we > ... somehow make it work without need to export this? > > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html Right now there are only have 4 counter devices supported in this patchset, but it is expected that support for a greater variety of devices will be added. For these future cases, new count directions will be added to match their functionality. For example, suppose support for a rotary encoder device is added. These type of devices do not move forward/backward but rather rotate. In these cases, the following count directions may be added: [COUNTER_COUNT_DIRECTION_CLOCKWISE] = "clockwise", [COUNTER_COUNT_DIRECTION_COUNTERCLOCKWISE] = "counterclockwise" Or as another example, suppose support for a two-axis precision positioning table is added. These devices support positioning in a cartesian coordinate system. In these cases, spatial direction may serve as useful count directions: [COUNTER_COUNT_DIRECTION_NORTH] = "north", [COUNTER_COUNT_DIRECTION_NORTHEAST] = "northeast", [COUNTER_COUNT_DIRECTION_EAST] = "east", [COUNTER_COUNT_DIRECTION_SOUTHEAST] = "southeast", [COUNTER_COUNT_DIRECTION_SOUTH] = "south", [COUNTER_COUNT_DIRECTION_SOUTHWEST] = "southwest", [COUNTER_COUNT_DIRECTION_WEST] = "west", [COUNTER_COUNT_DIRECTION_NORTHWEST] = "northwest" A const table is conveinent in these scenarios because support for new count directions may be easily added by simple entry into the table. William Breathitt Gray