public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, alan@linux.intel.com,
	tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	feng.tang@intel.com, jacob.jun.pan@linux.intel.com
Subject: Re: [PATCH 1/3] mfd: add Intel MSIC driver
Date: Wed, 21 Sep 2011 12:44:56 +0200	[thread overview]
Message-ID: <20110921104456.GV32263@sortiz-mobl> (raw)
In-Reply-To: <20110921080717.GK23578@intel.com>

Hi Mika,

On Wed, Sep 21, 2011 at 11:07:17AM +0300, Mika Westerberg wrote:
> > > +/*
> > > + * Other MSIC related devices which are not directly available via SFI DEVS
> > > + * table. 
> > Would that mean a broken firmware, or something else I'm missing ?
> > It looks odd.
> 
> Not all devices in the MSIC are listed in SFI DEVS table. For example
> regulators are missing. We currently don't have regulator support for MSIC
> but once it is added the devices will be created here.
> 
> Audio codec is similar - it does not exist in the SFI DEVS table.
Ok. So I can expect further patches removing this one then.


> > > +/**
> > > + * intel_msic_reg_read - read a single MSIC register
> > > + * @reg: register to read
> > > + * @val: register value is placed here
> > > + *
> > > + * Read a single register from MSIC. Returns %0 on success and negative
> > > + * errno in case of failure.
> > > + *
> > > + * Function may sleep.
> > > + */
> > > +int intel_msic_reg_read(unsigned short reg, u8 *val)
> > > +{
> > > +	return intel_scu_ipc_ioread8(reg, val);
> > > +}
> > > +EXPORT_SYMBOL_GPL(intel_msic_reg_read);
> > > +
> > > +/**
> > > + * intel_msic_reg_write - write a single MSIC register
> > > + * @reg: register to write
> > > + * @val: value to write to that register
> > > + *
> > > + * Write a single MSIC register. Returns 0 on success and negative
> > > + * errno in case of failure.
> > > + *
> > > + * Function may sleep.
> > > + */
> > > +int intel_msic_reg_write(unsigned short reg, u8 val)
> > > +{
> > > +	return intel_scu_ipc_iowrite8(reg, val);
> > > +}
> > > +EXPORT_SYMBOL_GPL(intel_msic_reg_write);
> > What is the benefit of those wrappers since you're probably not going to get
> > rid of the SCU IPC APIs, right ? What's wrong with the subdevices using the
> > SCU IPC API directly ?
> 
> Right, we are not going to get rid of SCU IPC APIs. The idea behind having
> these register access wrapper functions is that we are now able to separate
> the MSIC subdevices from other SCU IPC usage. In other words we get a bit
> cleaner "architecture".
I'm not entirely convinced that wrapping around the IPC API gives you a
cleaner architecture.

 
> It also allows us to add caching and intercepting register accesses if a
> need rises.
That would define a real need for this API, yes.


> > > +	for (i = 0; i < ARRAY_SIZE(msic_devs); i++) {
> > > +		if (!pdata->irq[i])
> > > +			continue;
> > I would expect some sort of warning here since it would mean your platform
> > code defined a sub device platform data without giving you the right IRQ. And
> > afaiu, all of your sub devices must have one.
> 
> The interface for platform data says that if irq is zero, it means that no
> platform device is created.
> 
> For example in patch 3/3 we add the platform data for battery, gpio, audio,
> power_button and ocd but the SFI table actually contains more devices. We
> don't yet have (upstream) driver for those so there is a little point of
> creating platform device for them at this point.

Ok, I see.

So, I'm fine with this patch, at least the MFD part. I'll go ahead and apply
it to my for-next branch. I'd appreciate to get ACKs or NACKs for the x86
parts from the relevant people though.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  reply	other threads:[~2011-09-21 10:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07 13:06 [PATCH 0/3] Intel MSIC MFD driver for Medfield platform Mika Westerberg
2011-09-07 13:06 ` [PATCH 1/3] mfd: add Intel MSIC driver Mika Westerberg
2011-09-20 17:17   ` Samuel Ortiz
2011-09-21  8:07     ` Mika Westerberg
2011-09-21 10:44       ` Samuel Ortiz [this message]
2011-09-21 11:12         ` Mika Westerberg
2011-09-07 13:06 ` [PATCH 2/3] x86, mrst: Some drivers need to known when an SCU is available Mika Westerberg
2011-09-07 13:06 ` [PATCH 3/3] x86, mrst: add platform support for MSIC MFD driver Mika Westerberg
2011-10-14  7:59   ` Mika Westerberg
2011-10-18  9:13     ` Samuel Ortiz
2011-10-18  9:41       ` [PATCH v2] " Mika Westerberg
2011-10-20 16:47         ` Samuel Ortiz
2011-09-19  7:34 ` [PATCH 0/3] Intel MSIC MFD driver for Medfield platform Mika Westerberg
2011-09-19  8:05   ` Samuel Ortiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110921104456.GV32263@sortiz-mobl \
    --to=sameo@linux.intel.com \
    --cc=alan@linux.intel.com \
    --cc=feng.tang@intel.com \
    --cc=hpa@zytor.com \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox