From: b.zolnierkie@samsung.com (Bartlomiej Zolnierkiewicz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V4 1/2] Phy: Exynos: Add Exynos5250 sata phy driver
Date: Tue, 07 Jan 2014 15:22:58 +0100 [thread overview]
Message-ID: <2078358.4WniMksEuS@amdc1032> (raw)
In-Reply-To: <CAKuRcOJVQ9U_4rpUf-6+=nbO=UoNkkTU5ttmRqfWxi4_nh7fag@mail.gmail.com>
Hi,
On Thursday, January 02, 2014 07:03:23 PM Yuvaraj Kumar wrote:
> On Tue, Dec 31, 2013 at 9:00 PM, Bartlomiej Zolnierkiewicz
> <b.zolnierkie@samsung.com> wrote:
> >> @@ -8,3 +8,4 @@ obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o
> >> obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o
> >> obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o
> >> obj-$(CONFIG_TWL4030_USB) += phy-twl4030-usb.o
> >> +obj-$(CONFIG_EXYNOS5250_SATA_PHY) += sata_phy_exynos5250.o exynos5250_phy_i2c.o
> >
> > Will this compile/work without I2C support?
> No.I missed this.It will not compile without I2C support.
> How about below change in drivers/phy/Kconfig ?
> config EXYNOS5250_SATA_PHY
> select I2C
> select I2C_S3C2410
Fine with me.
> > CONFIG_EXYNOS5250_SATA_PHY doesn't require it currently.
> I didnt get this. what it doesn't require?
It doesn't require I2C. If you add above I2C selects it will be OK.
> >> +struct i2c_driver sataphy_i2c_driver = {
> >
> > Keeping it global together with sataphy_attach_i2c_client() is not very
> > nice. I've talked with our local device tree guru (a.k.a. Tomasz Figa)
> > about this and it may be that this i2c driver is not even necessary.
> Can you elaborate more on this?
The usage of the global i2c driver is not a proper solution.
i2c driver should register itself in the driver init function
(which is not present currently) instead of being registered by
the SATA PHY driver.
The SATA PHY driver should find i2c client device using DT.
sataphy_attach_i2c_client() should then be removed.
> > If you manage to extract i2c adapter and address data from the device
> > tree (using proper of_* methods) they can be used instead of i2c client
> > data in the SATA PHY driver.
> I think the above is true, if the complete SATA PHY controller sits on
> the i2c adapter.
> But in Exynos5250 case,only the few configurations ( CMU and TRSV
> blocks ) SATA PHY
> are done through I2C(channel 9). Correct me if i am wrong.
Well, it shouldn't matter if all or only some of the configuration of
the SATA PHY controller is done through i2c.
Anyway, how about another idea -> adding a new phandle of i2c client
device to SATA PHY DT entry and using DT in the SATA PHY driver to
find i2c client device?
i.e. "samsung,exynos-sataphy-i2c-phandle" property in SATA PHY
controller DT entry can point at existing "sata-phy at 38" sataphy i2c
client DT entry (by adding new label to it, i.e. "sata_phy_i2c").
Such new phandle can be used first to find the DT device node of i2c
device (by using of_parse_phandle(), if it returns NULL the error
should be returned) and then later to find proper i2c client device
(by using of_find_i2c_device_by_node(), if it returns NULL deferred
probing should be requested by returning -EPROBE_DEFER).
i2c at 121D0000 {
...
sata_phy_i2c: sata-phy at 38 {
...
};
...
};
sata_phy: sata-phy at 12170000 {
...
samsung,exynos-sataphy-i2c-phandle = <&sata_phy_i2c>;
...
};
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
next prev parent reply other threads:[~2014-01-07 14:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-30 13:07 [PATCH V4 0/2] Exynos5250 SATA Support Yuvaraj Kumar C D
2013-12-30 13:07 ` [PATCH V4 1/2] Phy: Exynos: Add Exynos5250 sata phy driver Yuvaraj Kumar C D
2013-12-31 10:48 ` Kishon Vijay Abraham I
2014-01-02 13:43 ` Yuvaraj Kumar
2014-01-07 9:34 ` Kishon Vijay Abraham I
2013-12-31 15:30 ` Bartlomiej Zolnierkiewicz
2014-01-02 13:33 ` Yuvaraj Kumar
2014-01-07 14:22 ` Bartlomiej Zolnierkiewicz [this message]
2014-01-08 13:09 ` Yuvaraj Kumar
2014-01-08 15:46 ` Bartlomiej Zolnierkiewicz
2014-01-09 10:06 ` Yuvaraj Kumar
2013-12-30 13:07 ` [PATCH V4 2/2] ARM: dts: Enable ahci sata and sata phy Yuvaraj Kumar C D
2013-12-31 15:44 ` Bartlomiej Zolnierkiewicz
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=2078358.4WniMksEuS@amdc1032 \
--to=b.zolnierkie@samsung.com \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox