From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754725AbdERFze (ORCPT ); Thu, 18 May 2017 01:55:34 -0400 Received: from relay07.alfahosting-server.de ([109.237.142.243]:15169 "EHLO relay07.alfahosting-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754013AbdERFzb (ORCPT ); Thu, 18 May 2017 01:55:31 -0400 X-Spam-DCC: : Subject: Re: Microchip USB Hub Driver Harmonization To: Krzysztof Kozlowski , Richard Leitner References: <20170517160152.t34t43ocbzebpkfg@kozik-lap> Cc: Linux USB List , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Javier Martinez Canillas , Richard Leitner , Stephen Boyd From: Richard Leitner Message-ID: <3f2206e3-8b25-c6d7-505a-d4bb2fb5d66a@g0hl1n.net> Date: Thu, 18 May 2017 07:33:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170517160152.t34t43ocbzebpkfg@kozik-lap> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/17/2017 06:01 PM, Krzysztof Kozlowski wrote: > On Wed, May 17, 2017 at 12:58:38PM +0200, Richard Leitner wrote: >> ... >> >> 1. Currently usb251xb uses i2c_smbus_*, usb3503 uses regmap_* and >> usb4604 uses i2c_master_* functions for the hub configuration. What >> would be the preferred solution? > > regmap? It is already widely used for I2C drivers. I think most (or even > all?) new I2C drivers use regmap. It hides the real bus between common > regmap API. Ok. Thanks for that information. Then I will go for regmap. > >> 2. What would be a good prefix for common headers/functions/macros/etc.? >> I thought of "mcusbhub"... Would that be OK? Or are there any >> conventions/better proposals on that? > > If you are going to develop one driver for entire family, then you could > even choose just one name. Let's say the most generic. > > I don't quite understand the meaning behind "harmonizing drivers". I'm currently evaluating if it is feasible to create one common driver for all USBxxxx hubs. Due to the fact there are currently only 3 hub types implemented mainline (the Microchip homepage lists 36 USB Hub products [1]) it involves quite a lot data-sheet reading ;-) As a first step (and also the final one if implementing a common driver is not feasible) I thought of creating a common header/source file which implements all "re-useable" functions/macros/etc. Would that also be an accepted solution? > >> 3. Currently only usb3503 supports "platform data". Is this still needed >> or may it be removed? > > I think it is still used, e.g. by: > arch/arm/boot/dts/exynos5250-spring.dts Please correct me if I'm wrong, but isn't that DT only? The reason why I'm asking if it may be removed is because the only file including "linux/platform_data/usb3503.h" is the usb3503.c driver itself and it's also the only file using "struct usb3503_platform_data". Thanks & kind regards, RichardL [1] https://www.microchip.com/design-centers/usb/usb-hubs-and-devices/products/overview