From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753721AbeCQTQF (ORCPT ); Sat, 17 Mar 2018 15:16:05 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:39276 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752836AbeCQTQC (ORCPT ); Sat, 17 Mar 2018 15:16:02 -0400 X-Google-Smtp-Source: AG47ELsZgX3VnMWtLs4YkkkngBbbU08yexY3eEYBUEmIUft5+gra0Lg7j2QICCs5ao08tNhDN7ZWNw== Date: Sat, 17 Mar 2018 15:15:55 -0400 From: William Breathitt Gray To: Andy Shevchenko Cc: Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , linux-iio@vger.kernel.org, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Subject: Re: [PATCH v3 1/8] iio: stx104: Implement get_multiple callback Message-ID: <20180317191555.GA14672@sophia> References: <14a09900bf4642495ebe4072b9eb02769dbc4c5e.1521301345.git.vilhelm.gray@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 17, 2018 at 08:51:07PM +0200, Andy Shevchenko wrote: >On Sat, Mar 17, 2018 at 5:49 PM, William Breathitt Gray > wrote: >> The Apex Embedded Systems STX104 series of devices provides 4 TTL >> compatible lines of inputs accessed via a single 4-bit port. Since four >> input lines are acquired on a single port input read, the STX104 GPIO >> driver may improve multiple input reads by utilizing a get_multiple >> callback. This patch implements the stx104_gpio_get_multiple function >> which serves as the respective get_multiple callback. > >> +static int stx104_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask, >> + unsigned long *bits) >> +{ >> + struct stx104_gpio *const stx104gpio = gpiochip_get_data(chip); >> + > >> + *bits = inb(stx104gpio->base); > >I think on LE and BE if will give you different results. That may be true for a memcpy operation, but in this case I'm relying on the standard C evaluation rules. I expect we should be fine with the returned byte assigned to an unsigned long, since it'll be evaluated by its value rather than memory representation. William Breathitt Gray > >> + >> + return 0; >> +} > > > >-- >With Best Regards, >Andy Shevchenko