* [PATCH RESEND] drivers: i2c: s3c2410: add support for HDMIPHY dedicated controller
@ 2011-09-22 10:24 Marek Szyprowski
[not found] ` <1316687096-18307-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Marek Szyprowski @ 2011-09-22 10:24 UTC (permalink / raw)
To: linux-i2c, linux-samsung-soc
Cc: Marek Szyprowski, Kyungmin Park, Ben Dooks, Kukjin Kim,
Tomasz Stanislawski
From: Tomasz Stanislawski <t.stanislaws@samsung.com>
This patch adds support for I2C HDMIPHY dedicated controller. It has
different timeout handling and reset conditions.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
drivers/i2c/busses/i2c-s3c2410.c | 36 +++++++++++++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index f84a63c..e456cf9 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -54,6 +54,7 @@ enum s3c24xx_i2c_state {
enum s3c24xx_i2c_type {
TYPE_S3C2410,
TYPE_S3C2440,
+ TYPE_S3C2440_HDMIPHY,
};
struct s3c24xx_i2c {
@@ -96,7 +97,21 @@ static inline int s3c24xx_i2c_is2440(struct s3c24xx_i2c *i2c)
enum s3c24xx_i2c_type type;
type = platform_get_device_id(pdev)->driver_data;
- return type == TYPE_S3C2440;
+ return type == TYPE_S3C2440 || type == TYPE_S3C2440_HDMIPHY;
+}
+
+/* s3c24xx_i2c_is2440_hdmiphy()
+ *
+ * return true is this is an s3c2440 dedicated for HDMIPHY interface
+*/
+
+static inline int s3c24xx_i2c_is2440_hdmiphy(struct s3c24xx_i2c *i2c)
+{
+ struct platform_device *pdev = to_platform_device(i2c->dev);
+ enum s3c24xx_i2c_type type;
+
+ type = platform_get_device_id(pdev)->driver_data;
+ return type == TYPE_S3C2440_HDMIPHY;
}
/* s3c24xx_i2c_master_complete
@@ -460,6 +475,13 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c)
unsigned long iicstat;
int timeout = 400;
+ /* if hang-up of HDMIPHY occured reduce timeout
+ * The controller will work after reset, so waiting
+ * 400 ms will cause unneccessary system hangup
+ */
+ if (s3c24xx_i2c_is2440_hdmiphy(i2c))
+ timeout = 10;
+
while (timeout-- > 0) {
iicstat = readl(i2c->regs + S3C2410_IICSTAT);
@@ -469,6 +491,15 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c)
msleep(1);
}
+ /* hang-up of bus dedicated for HDMIPHY occured, resetting */
+ if (s3c24xx_i2c_is2440_hdmiphy(i2c)) {
+ writel(0, i2c->regs + S3C2410_IICCON);
+ writel(0, i2c->regs + S3C2410_IICSTAT);
+ writel(0, i2c->regs + S3C2410_IICDS);
+
+ return 0;
+ }
+
return -ETIMEDOUT;
}
@@ -1008,6 +1039,9 @@ static struct platform_device_id s3c24xx_driver_ids[] = {
}, {
.name = "s3c2440-i2c",
.driver_data = TYPE_S3C2440,
+ }, {
+ .name = "s3c2440-hdmiphy-i2c",
+ .driver_data = TYPE_S3C2440_HDMIPHY,
}, { },
};
MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids);
--
1.7.1.569.g6f426
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH RESEND] drivers: i2c: s3c2410: add support for HDMIPHY dedicated controller
[not found] ` <1316687096-18307-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2011-10-11 11:01 ` Kukjin Kim
2011-11-22 10:48 ` Tomasz Stanislawski
2011-11-22 11:23 ` Tomasz Stanislawski
0 siblings, 2 replies; 4+ messages in thread
From: Kukjin Kim @ 2011-10-11 11:01 UTC (permalink / raw)
To: 'Marek Szyprowski', linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA
Cc: 'Kyungmin Park', 'Ben Dooks',
'Tomasz Stanislawski'
Marek Szyprowski wrote:
>
> From: Tomasz Stanislawski <t.stanislaws-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>
> This patch adds support for I2C HDMIPHY dedicated controller. It has
> different timeout handling and reset conditions.
>
> Signed-off-by: Tomasz Stanislawski <t.stanislaws-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Acked-by: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Hi Ben,
If you're ok with this, please apply this to go to upstream via your i2c
tree.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
> ---
> drivers/i2c/busses/i2c-s3c2410.c | 36
> +++++++++++++++++++++++++++++++++++-
> 1 files changed, 35 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c
b/drivers/i2c/busses/i2c-s3c2410.c
> index f84a63c..e456cf9 100644
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -54,6 +54,7 @@ enum s3c24xx_i2c_state {
> enum s3c24xx_i2c_type {
> TYPE_S3C2410,
> TYPE_S3C2440,
> + TYPE_S3C2440_HDMIPHY,
> };
>
> struct s3c24xx_i2c {
> @@ -96,7 +97,21 @@ static inline int s3c24xx_i2c_is2440(struct s3c24xx_i2c
*i2c)
> enum s3c24xx_i2c_type type;
>
> type = platform_get_device_id(pdev)->driver_data;
> - return type == TYPE_S3C2440;
> + return type == TYPE_S3C2440 || type == TYPE_S3C2440_HDMIPHY;
> +}
> +
> +/* s3c24xx_i2c_is2440_hdmiphy()
> + *
> + * return true is this is an s3c2440 dedicated for HDMIPHY interface
> +*/
> +
> +static inline int s3c24xx_i2c_is2440_hdmiphy(struct s3c24xx_i2c *i2c)
> +{
> + struct platform_device *pdev = to_platform_device(i2c->dev);
> + enum s3c24xx_i2c_type type;
> +
> + type = platform_get_device_id(pdev)->driver_data;
> + return type == TYPE_S3C2440_HDMIPHY;
> }
>
> /* s3c24xx_i2c_master_complete
> @@ -460,6 +475,13 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c
*i2c)
> unsigned long iicstat;
> int timeout = 400;
>
> + /* if hang-up of HDMIPHY occured reduce timeout
> + * The controller will work after reset, so waiting
> + * 400 ms will cause unneccessary system hangup
> + */
> + if (s3c24xx_i2c_is2440_hdmiphy(i2c))
> + timeout = 10;
> +
> while (timeout-- > 0) {
> iicstat = readl(i2c->regs + S3C2410_IICSTAT);
>
> @@ -469,6 +491,15 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c
*i2c)
> msleep(1);
> }
>
> + /* hang-up of bus dedicated for HDMIPHY occured, resetting */
> + if (s3c24xx_i2c_is2440_hdmiphy(i2c)) {
> + writel(0, i2c->regs + S3C2410_IICCON);
> + writel(0, i2c->regs + S3C2410_IICSTAT);
> + writel(0, i2c->regs + S3C2410_IICDS);
> +
> + return 0;
> + }
> +
> return -ETIMEDOUT;
> }
>
> @@ -1008,6 +1039,9 @@ static struct platform_device_id
s3c24xx_driver_ids[] = {
> }, {
> .name = "s3c2440-i2c",
> .driver_data = TYPE_S3C2440,
> + }, {
> + .name = "s3c2440-hdmiphy-i2c",
> + .driver_data = TYPE_S3C2440_HDMIPHY,
> }, { },
> };
> MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids);
> --
> 1.7.1.569.g6f426
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] drivers: i2c: s3c2410: add support for HDMIPHY dedicated controller
2011-10-11 11:01 ` Kukjin Kim
@ 2011-11-22 10:48 ` Tomasz Stanislawski
2011-11-22 11:23 ` Tomasz Stanislawski
1 sibling, 0 replies; 4+ messages in thread
From: Tomasz Stanislawski @ 2011-11-22 10:48 UTC (permalink / raw)
To: linux-samsung-soc; +Cc: linux-i2c
Hello Ben,
Recently, I've been asked a few times for help with S5P-TV drivers.
The problems were caused by HDMIPHY driver. The driver failed due to the
lack of i2c-s3c2410 patch. Merging the patch is needed for HDMI support
for S5P platform.
What is the current state of the patch?
Is it going to be merged in 3.3?
Best regards,
Tomasz Stanislawski
On 10/11/2011 01:01 PM, Kukjin Kim wrote:
> Marek Szyprowski wrote:
>>
>> From: Tomasz Stanislawski<t.stanislaws@samsung.com>
>>
>> This patch adds support for I2C HDMIPHY dedicated controller. It has
>> different timeout handling and reset conditions.
>>
>> Signed-off-by: Tomasz Stanislawski<t.stanislaws@samsung.com>
>> Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>> Signed-off-by: Marek Szyprowski<m.szyprowski@samsung.com>
>
> Acked-by: Kukjin Kim<kgene.kim@samsung.com>
>
> Hi Ben,
>
> If you're ok with this, please apply this to go to upstream via your i2c
> tree.
>
> Thanks.
>
> Best regards,
> Kgene.
> --
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] drivers: i2c: s3c2410: add support for HDMIPHY dedicated controller
2011-10-11 11:01 ` Kukjin Kim
2011-11-22 10:48 ` Tomasz Stanislawski
@ 2011-11-22 11:23 ` Tomasz Stanislawski
1 sibling, 0 replies; 4+ messages in thread
From: Tomasz Stanislawski @ 2011-11-22 11:23 UTC (permalink / raw)
To: 'Ben Dooks'
Cc: Kukjin Kim, 'Marek Szyprowski', linux-i2c,
linux-samsung-soc, 'Kyungmin Park', Asbjørn Djupdal,
Hatim Ali
Hello Ben,
Recently, I've been asked a few times for help with S5P-TV drivers.
The problems were caused by HDMIPHY driver. The driver failed due to the
lack of i2c-s3c2410 patch. Merging the patch is needed for HDMI support
for S5P platform.
What is the current state of the patch?
Is it going to be merged in 3.3?
Best regards,
Tomasz Stanislawski
On 10/11/2011 01:01 PM, Kukjin Kim wrote:
> Marek Szyprowski wrote:
>>
>> From: Tomasz Stanislawski<t.stanislaws@samsung.com>
>>
>> This patch adds support for I2C HDMIPHY dedicated controller. It has
>> different timeout handling and reset conditions.
>>
>> Signed-off-by: Tomasz Stanislawski<t.stanislaws@samsung.com>
>> Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>> Signed-off-by: Marek Szyprowski<m.szyprowski@samsung.com>
>
> Acked-by: Kukjin Kim<kgene.kim@samsung.com>
>
> Hi Ben,
>
> If you're ok with this, please apply this to go to upstream via your i2c
> tree.
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim<kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-22 11:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-22 10:24 [PATCH RESEND] drivers: i2c: s3c2410: add support for HDMIPHY dedicated controller Marek Szyprowski
[not found] ` <1316687096-18307-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2011-10-11 11:01 ` Kukjin Kim
2011-11-22 10:48 ` Tomasz Stanislawski
2011-11-22 11:23 ` Tomasz Stanislawski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).