From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Balean Date: Thu, 6 Apr 2017 00:34:19 -0500 Subject: [U-Boot] [PATCH] Add 8 and 16-bit single register pin controller support In-Reply-To: <760ef132-6b3b-b219-e5f6-00e95927dcbe@ltec.ch> References: <1490594146-4562-1-git-send-email-james@balean.com.au> <760ef132-6b3b-b219-e5f6-00e95927dcbe@ltec.ch> Message-ID: <1491456859-11010-1-git-send-email-james@balean.com.au> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi All, Thank you for your responses. I will submit a new version of the patch with your suggestions following this. On 1 April 2017 at 15:22, Simon Glass wrote: > Can you explain in your commit message why we want this? Will do. I will be seeking to add TI OMAP device tree support to U-Boot shortly, and 16-bit register widths are needed for pinmux configuration on these platforms. Don't have an immediate need for 8-bit though, so will remove this. > I think ulong is better than fdt32_t, which is associated with devices > tree. Concur. Thanks for this suggestion. > Instead of lots of little functions, could you have: > > pcs_read(ulong reg, int size) > { > switch (size) { > case 8: > return readb(reg); > ... I tried to maintain consistency with mainline Linux with the separate read functions, however it makes sense to combine the little functions. On 2 April 2017 at 20:53, Felix Brack wrote: > I also prefer this. The corresponding switch is already there in > 'single_configure_pins(..)', i.e. no need for an additional function. > Using the existing function also eliminates the 'pcs_' prefix which I > would have preferred to be 'single_' due to naming consistency > (nitpicking, I admit). Thanks. Yes, I will rename this to 'single_' for consistency with the other functions (the pcs_ prefix was for consistency with Linux's pinctrl-single driver, however it doesn't make sense to copy this convention). Keen for your thoughts on v2 of the patch (which I'll submit shortly) as to me it seems cleaner to have the register read and write switches in two separate functions, rather than in the 'single_configure_pins(..)'. Thanks again, James