All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: carl peng <carlpeng008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2] i2c-designware: Add suport for AMD i2c controller
Date: Fri, 5 Sep 2014 12:36:01 +0300	[thread overview]
Message-ID: <20140905093601.GQ3632@lahna.fi.intel.com> (raw)
In-Reply-To: <CAC5e1Fppiin2OczBUeyACOijWN3DocUKcRJKw31G+8-zX+mxpg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Fri, Sep 05, 2014 at 03:19:50PM +0800, carl peng wrote:
> Hi Mika,
> 
> Could I consult a problem with you?

Sure.

> 
> As you suggest, there are some samples that add the device clk to the
> clock framework in the acpi_lpss.c. But I encounter some problems when
> add the AMD i2c clk to the clock framework.
> In acpi_lpss.c, as the patch d6ddaaac8f5c37ad84d said, When the
> CONFIG_X86_INTEL_LPSS is not defined, then only add the device ID
> list, but not implement the callbacks like "attach =
> acpi_lpss_create_device" , so if
> CONFIG_X86_INTEL_LPSS is not defined, will not create clk dev.
> 
> So there will be some problems when I add the AMD i2c clk to the clock
> framework.
> if I do not define CONFIG_X86_INTEL_LPSS, then even though I add the IDs and
> lpss_device_desc struct into the acpi_lpss.c, the AMD i2c clk will
> also can not  be added into the clock framework. But if I add the AMD
> i2c related IDs and struct in the CONFIG_X86_INTEL_LPSS, it may cause
> some misunderstand in the future, it is a AMD device, why is it put
> into the CONFIG_X86_INTEL_LPSS branch.
> 
> So, Could you please give some suggestions to me?
> Which should I choose?
> Add the AMD i2c clk IDs and related lpss_device_desc into the
> CONFIG_X86_INTEL_LPSS branch, or re-write a new branch by imitating
> the
> CONFIG_X86_INTEL_LPSS branch  included by CONFIG_AMD_INTEL_LPSS.

Since the AMD part is probably too different from Intel LPSS devices, I
would rather not add it there. So you have two options AFAICT:

 1) Add the clock in drivers/acpi/acpi_platform.c
 2) Create custom i2c_get_clk_rate_khz() in the driver, just like in
    this patch but drop all the unnecessary vendor etc. dance.

For the 2) you could pass the clock rate in ->driver_data and if it is
non-zero, setup a custom clock rate function that then uses the value
from ->driver_data or so.

Not sure if Wolfram likes that but we don't have too many places in x86
world where we can create clocks :-(

  parent reply	other threads:[~2014-09-05  9:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04 12:30 [PATCH v2] i2c-designware: Add suport for AMD i2c controller Carl Peng
     [not found] ` <1409833805-1574-1-git-send-email-carlpeng008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-04 12:50   ` Mika Westerberg
     [not found]     ` <20140904125029.GD3632-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2014-09-05  7:19       ` carl peng
     [not found]         ` <CAC5e1Fppiin2OczBUeyACOijWN3DocUKcRJKw31G+8-zX+mxpg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-05  9:36           ` Mika Westerberg [this message]
     [not found]             ` <20140905093601.GQ3632-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2014-09-15 11:58               ` carl peng
     [not found]                 ` <CAC5e1FoA5g7dGuWbjjafirzXFrk+zCR3eegmgizTmYp2B1tNsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-15 12:10                   ` Mika Westerberg

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=20140905093601.GQ3632@lahna.fi.intel.com \
    --to=mika.westerberg-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=carlpeng008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.