From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933441AbdEVREk (ORCPT ); Mon, 22 May 2017 13:04:40 -0400 Received: from david.siemens.de ([192.35.17.14]:42156 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbdEVREf (ORCPT ); Mon, 22 May 2017 13:04:35 -0400 Subject: Re: [PATCH v2 5/6] gpio-exar/8250-exar: Make set of exported GPIOs configurable To: Andy Shevchenko Cc: Greg Kroah-Hartman , Linus Walleij , Alexandre Courbot , Linux Kernel Mailing List , "linux-serial@vger.kernel.org" , "linux-gpio@vger.kernel.org" , Sudip Mukherjee , Sascha Weisenberger References: <357209721396d57cb871ae69d72308b1a7c9cbd7.1495119548.git.jan.kiszka@siemens.com> <83279eaf-69aa-333c-58b8-202d221375d3@siemens.com> From: Jan Kiszka Message-ID: <587cb3e6-1b6b-1be1-1362-8192a56d647d@siemens.com> Date: Mon, 22 May 2017 19:04:27 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-05-22 18:33, Andy Shevchenko wrote: > On Sun, May 21, 2017 at 2:43 PM, Jan Kiszka wrote: >> On 2017-05-18 19:43, Andy Shevchenko wrote: >>> On Thu, May 18, 2017 at 5:59 PM, Jan Kiszka wrote: >>>> On the SIMATIC, IOT2040 only a single pin is exportable as GPIO, the > >>>> + pdata.first_gpio = first_gpio; >>>> + pdata.ngpio = ngpio; >>> >>> Still thinking about device properties ("ngpios" and something like >>> "exar8250,gpio-start"). >> >> Changed back to properties, removing all platform data. >> >> But what's the purpose of prefixing the name here? This does not have >> anything to do with device trees. It's a private parameter channel >> between the creating device driver and the gpio driver, and there will >> be no other bindings. > > To avoid potential collision with registered official property, that's > why better to use prefix. > (I didn't find anything like GPIO start / pin in registered > properties, maybe there is one) When using the "public" channel devices properties, we cannot prevent that people set some for the device, despite it is not supposed to be controlled by DT or ACPI. But I don't see where default properties should come from, except via intentionally designed DTs or ACPI tables. Anyway, I can prefix. > >>>> + unsigned int first_gpio; >>>> + unsigned int ngpio; >>> >>> u16 ? > >> If we do that, then we would rather have to choose u8. But this is >> pointless restriction. I prefer to stay with the native type. > > Still for properties it would be u32, wouldn't it? > Because properties ask for a type width, yes. I can align both to u32, though. Jan