From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 1/2] fm801: introduce macros to access the hardware Date: Mon, 28 Apr 2014 12:20:35 +0200 Message-ID: References: <1398672030-29565-1-git-send-email-andy.shevchenko@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 59F3A26089A for ; Mon, 28 Apr 2014 12:20:35 +0200 (CEST) In-Reply-To: <1398672030-29565-1-git-send-email-andy.shevchenko@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Andy Shevchenko Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 28 Apr 2014 11:00:29 +0300, Andy Shevchenko wrote: > > It will help to maintain HW accessors and, for example, switch from the > direct I/O to MMIO which is more convenient for PCI devices. > > Signed-off-by: Andy Shevchenko > --- > sound/pci/fm801.c | 131 ++++++++++++++++++++++++++++-------------------------- > 1 file changed, 68 insertions(+), 63 deletions(-) > > diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c > index db18cca..8418484 100644 > --- a/sound/pci/fm801.c > +++ b/sound/pci/fm801.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -34,8 +35,6 @@ > #include > #include > > -#include > - > #ifdef CONFIG_SND_FM801_TEA575X_BOOL > #include > #endif > @@ -80,7 +79,10 @@ MODULE_PARM_DESC(radio_nr, "Radio device numbers"); > * Direct registers > */ > > -#define FM801_REG(chip, reg) (chip->port + FM801_##reg) > +#define fm801_writew(v,chip,reg) outw((v), chip->port + FM801_##reg) > +#define fm801_readw(chip,reg) inw(chip->port + FM801_##reg) > + > +#define fm801_writel(v,chip,reg) outl((v), chip->port + FM801_##reg) IMO, it's better in a form like fm801_writel(chip, reg, value) thanks, Takashi