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=-2.2 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=unavailable 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 7211DC10F0E for ; Tue, 9 Apr 2019 04:56:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 421A120833 for ; Tue, 9 Apr 2019 04:56:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qRqkD2SR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Culiuvlb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 421A120833 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mDlPdHJrZVKjI4KrSusnq6nULQuZG9bt+vrQqrKxeII=; b=qRqkD2SRd+HC0c keEbfJeyzZUi4xyxZWtctHRlfJuwpA1w73XTQAEqQFAA2DuK7EHcoSydgTO7W4qcmSZbyL9CIRB7z opNjYBXWWEPaeLRqT0VEBB0c5s6z3XSodB6bgZVJOLCvFH6JtTvd4kUFvACeby6NldfMWDJm2AVMJ uLZ1RMVnXX5vL6Vp345dMbjYvFNu7w8y6kn+PJQ7h017jmH/tbAOBTAGbRaad/HEL5dN3loOuRRfc MA8uYFOGPcQJFlPwR0cQv3PxiKINbk4GN84DG/SgAEzy0f54Lj9JAavSLGiqoZZSvKJ7vCh30Mb9y Fq5uiZ2nWXfU4SJzGiEg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDioP-0002cr-Ff; Tue, 09 Apr 2019 04:56:45 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDioL-0002cW-PK for linux-arm-kernel@lists.infradead.org; Tue, 09 Apr 2019 04:56:43 +0000 Received: by mail-pf1-x443.google.com with SMTP id c207so8948348pfc.7 for ; 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=EJ3thBgHdXw6iDWxS/iYkEmAIwxvgHNF/6hGLphZ588Z7LEunfS5bkBzPiW+5WKqvr vOjDt4OOCVVXPEqkG+VVlStoJzOQLIZ7TxNQ/3OX5R1S2am/5kcJXTCNm9lly9aYvjBX dMN+VpTf4PHvVqDOqo/AawXhhgpSrTwcH846tVbG2UfoO4ZXLufibAvoU7bvJAWeBJhL OydiPlTfXM6rd3Pa4mTJTZWJ0YW+8sj82e6L9qHMc6+RzLV1vMIcFEvg1rZdTWSl/VTS Mn3F0bXjvVyW8lRNl290sG0ydwcV1mIxIbH55RxP81kkOFzAUBmt66PppP7T3UZ0yuUL ecEg== X-Gm-Message-State: APjAAAWTY4RXKTi5zhWY41qkQareBykxA5jkNqBRvDlOrEPso8KoMScq JFcUedsU5ebk1XwMfJsPsPs= X-Google-Smtp-Source: APXvYqzVtYQ7/TWepFOzztOXYsTBLeJbErgA6c9WPKnHOmXfWudaRv0t8mDaEzmknLvq8tWARXeHxg== 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 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-Disposition: inline In-Reply-To: <20190408215515.GA27592@amd> User-Agent: Mutt/1.11.4 (2019-03-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190408_215641_850140_4AC77794 X-CRM114-Status: GOOD ( 11.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, benjamin.gaignard@st.com, linux-pwm@vger.kernel.org, linux-iio@vger.kernel.org, patrick.havelange@essensium.com, thierry.reding@gmail.com, pmeerw@pmeerw.net, lars@metafoo.de, daniel.lezcano@linaro.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, david@lechnology.com, linuxppc-dev@lists.ozlabs.org, robh+dt@kernel.org, Jonathan Cameron , tglx@linutronix.de, fabrice.gasnier@st.com, esben@haabendal.dk, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, leoyang.li@nxp.com, knaack.h@gmx.de, akpm@linux-foundation.org, shawnguo@kernel.org, jic23@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel