From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH v2 1/2] mfd: rtsx: add func to split u32 into register Date: Mon, 1 Dec 2014 12:18:58 +0000 Message-ID: <20141201121858.GA11932@x1> References: <6a6de978f479758fb9e767d8a6e013e8a006a39a.1417141102.git.micky_ching@realsil.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-qc0-f181.google.com ([209.85.216.181]:48174 "EHLO mail-qc0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753051AbaLAMTF (ORCPT ); Mon, 1 Dec 2014 07:19:05 -0500 Received: by mail-qc0-f181.google.com with SMTP id m20so7364735qcx.26 for ; Mon, 01 Dec 2014 04:19:05 -0800 (PST) Content-Disposition: inline In-Reply-To: <6a6de978f479758fb9e767d8a6e013e8a006a39a.1417141102.git.micky_ching@realsil.com.cn> Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: micky_ching@realsil.com.cn Cc: sameo@linux.intel.com, chris@printf.net, ulf.hansson@linaro.org, devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, gregkh@linuxfoundation.org, dan.carpenter@oracle.com, rogerable@realtek.com, wei_wang@realsil.com.cn On Fri, 28 Nov 2014, micky_ching@realsil.com.cn wrote: > From: Micky Ching >=20 > Add helper function to write u32 to registers, if we want to put u32 > value to 4 continuous register, this can help us reduce tedious work. >=20 > Signed-off-by: Micky Ching > --- > include/linux/mfd/rtsx_pci.h | 9 +++++++++ > 1 file changed, 9 insertions(+) Does this supersede patch Dan was commenting on? > diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pc= i.h > index 74346d5..9234449 100644 > --- a/include/linux/mfd/rtsx_pci.h > +++ b/include/linux/mfd/rtsx_pci.h > @@ -558,6 +558,7 @@ > #define SD_SAMPLE_POINT_CTL 0xFDA7 > #define SD_PUSH_POINT_CTL 0xFDA8 > #define SD_CMD0 0xFDA9 > +#define SD_CMD_START 0x40 > #define SD_CMD1 0xFDAA > #define SD_CMD2 0xFDAB > #define SD_CMD3 0xFDAC > @@ -967,4 +968,12 @@ static inline u8 *rtsx_pci_get_cmd_data(struct r= tsx_pcr *pcr) > return (u8 *)(pcr->host_cmds_ptr); > } > =20 > +static inline void rtsx_pci_write_be32(struct rtsx_pcr *pcr, u16 reg= , u32 val) > +{ > + rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg, 0xFF, val >> 24); > + rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 1, 0xFF, val >> 16); > + rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 2, 0xFF, val >> 8); > + rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 3, 0xFF, val); > +} > + > #endif --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog