Received: by 10.213.65.68 with SMTP id h4csp506456imn; Sat, 17 Mar 2018 12:17:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELslg1WjDyCzSa3UZuxJEQ4qPwjXQDnaYpPU9dosqdujuqYb47jwwMI0jNE7zgTAPPWIv2F7 X-Received: by 10.98.205.140 with SMTP id o134mr5556305pfg.34.1521314239573; Sat, 17 Mar 2018 12:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521314239; cv=none; d=google.com; s=arc-20160816; b=cFxJGTdh8qAnfdFjZVUy3COU7pwj6AI5jP6/sa373HaBjM4LZSyyUw9fb/pfkSCDw9 uUKtXonobinzs2QXirMf4NBL8BtHPZGlxfdfgcbF8uwjMEjaYA5fWvneotqrqnoqLKbP Uegk8kU1h8mfCM8GxyhypsF4hWTzpMvr0xvIXSqgi78ajWq1lIPn6gNboE7MpM6OFt9R RuxATgUmrz8Rl/X0nTzTnla4fjSmHRSHqBBTOqIRlb4S7qNY97KI/7gscsiG5aLBUZnd Gt2jrXwZZX6nq/iUzOt7+z1r5DcgnYcpomjFQxSSLfifzlCdZgRi68OKudYCpxvgGEjo jTjA== 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:arc-authentication-results; bh=JtVNiEiWqQqMIbx7K6WbJdAUzWYHBS75BnOkbRWv9YA=; b=j48EtBCGd3K6b5YBUbtHCO5yMBg7we+CvyqXbS/PKp0lRUQOnXwwrd11OOEBMvJJul h7nvCGNcxrecVuG4Y5ZQaSXuyaKFu00WHUWu0MnT1NjXcU8gZy/9hLFNpSp8KYpIeBzX ArnhHbQfw3agb9m34AINy+5NkgTaujPxyn8c9rMqH6J/ueWZdg2BlTWX2wjjcqMN7hWG UR812u4uvcyVNBgMWXWcGm5ScFEtnfFS1agB8dk51I9BFq3OuG6POPSKIXkmFtTXytvE gc3vczbhb6dNK6EsNfQ8qgRhXSf23xV//lexUbygiyhDGxNstOWVIOhGSjjY9b07JVrU MDWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m3mkWtUi; 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 p1si7669667pfp.213.2018.03.17.12.17.02; Sat, 17 Mar 2018 12:17:19 -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=m3mkWtUi; 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 S1753709AbeCQTQF (ORCPT + 99 others); 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 Received: by mail-yw0-f193.google.com with SMTP id l24so9125133ywk.6; Sat, 17 Mar 2018 12:16:02 -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=JtVNiEiWqQqMIbx7K6WbJdAUzWYHBS75BnOkbRWv9YA=; b=m3mkWtUic/JwblosvFfsF/3uDFBw4wXPoELZnDlT458zE/F9yi8X4VacAsS6OfEv5/ 81FUP7x/08wrV76M7EzxZKv48t+9s1wyBYu+IXBy3N0R0ObWJP6r3OPTFtgeMtB9yezW dPcmLpo6bM8e2Lg9cuI1AqFcuSOpVH64uaDXTiktuUpADbOZDrAh/HETF91sHx3pHdcA dI2rRsgzuBY8h9mKQzkNQBVyMLhPw5dZeC/QyHY+7SAt28rMfafg8EAC1eXrY7RQKTqf A61YDmBs+A+tnQlAqGn0FJBsqLw1kSYT+JuYPv7CACvGTkbghp8dKERjVuP8gdev3Lzh mMlw== 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=JtVNiEiWqQqMIbx7K6WbJdAUzWYHBS75BnOkbRWv9YA=; b=R2DRi1FAINASseGVIEsEL7YAGKGRiz1VSAA+srKeLvVs4LkkrwRuYLo9rV+Ptau8Lp cjMXKKFBTqYkXLtyYYSv0esRFnawI1Ef2opnNkto66tqJKskNbxx+IdEljTONRpVQTKd gjlj0Pqb6OuhUS+u+SGWQQFlarjqzloplGXM0rj9qODHQnTMItDjKHHdWd2UFLkiPchq rCUFrjxcY+PPYMBCIrE7e2yKUK5UnEDd9oMMMrwesPHyPO91aWE5hXKv7y8apYafNP2H 9xWihzK9UHbRl9JBxWpeKnFyB92ILnhCD6vpnh+FNojtsfYqRpFAlp8CdKPK+JB6LwJY AFFA== X-Gm-Message-State: AElRT7GEfjsT3SG7TQ410LP7c2Q5N8jNHsuj0ZpFssSO2w3Q7zR6ZKvS iCbbajSOV5At06uOi+MhzI0= X-Received: by 2002:a25:7906:: with SMTP id u6-v6mr3860515ybc.385.1521314161729; Sat, 17 Mar 2018 12:16:01 -0700 (PDT) Received: from sophia ([72.188.97.40]) by smtp.gmail.com with ESMTPSA id m185sm2215584ywf.52.2018.03.17.12.16.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Mar 2018 12:16:01 -0700 (PDT) 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 Precedence: bulk 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