* [PATCH 0/7] s5p-fimc/mipi-csis drivers cleanup
@ 2012-09-17 10:48 Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 4/7] s5p-csis: Replace phy_enable platform data callback with direct call Sylwester Nawrocki
[not found] ` <1347879100-30150-1-git-send-email-s.nawrocki@samsung.com>
0 siblings, 2 replies; 6+ messages in thread
From: Sylwester Nawrocki @ 2012-09-17 10:48 UTC (permalink / raw)
To: linux-media, kgene.kim
Cc: linux-arm-kernel, kyungmin.park, sw0312.kim, linux-samsung-soc,
Sylwester Nawrocki
This series is a cleanup of s5p-fimc/mipi-csis drivers and changes required
for adding device tree support. It depends on Arnd's platform data headers
cleanup patch:
"ARM: samsung: move platform_data definitions"
git.kernel.org/?p=linux/kernel/git/arm/arm-soc.git;a=commit;h=d7243bd51b783ffd2
Sylwester Nawrocki (7):
ARM: samsung: Remove unused fields from FIMC and CSIS platform data
ARM: samsung: Change __s5p_mipi_phy_control() function signature
ARM: EXYNOS: Change MIPI-CSIS device regulator supply names
s5p-csis: Replace phy_enable platform data callback with direct call
s5p-fimc: Remove unused platform data structure fields
s5p-csis: Allow to specify pixel clock's source through platform data
s5p-csis: Change regulator supply names
arch/arm/mach-exynos/mach-nuri.c | 7 ++-----
arch/arm/mach-exynos/mach-origen.c | 4 ++--
arch/arm/mach-exynos/mach-universal_c210.c | 7 ++-----
arch/arm/plat-samsung/setup-mipiphy.c | 20 +++++++-------------
drivers/media/video/s5p-fimc/mipi-csis.c | 23 +++++++++++++----------
include/linux/platform_data/mipi-csis.h | 30 ++++++++++++------------------
include/media/s5p_fimc.h | 2 --
7 files changed, 38 insertions(+), 55 deletions(-)
--
1.7.11.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/7] s5p-csis: Replace phy_enable platform data callback with direct call
2012-09-17 10:48 [PATCH 0/7] s5p-fimc/mipi-csis drivers cleanup Sylwester Nawrocki
@ 2012-09-17 10:54 ` Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 5/7] s5p-fimc: Remove unused platform data structure fields Sylwester Nawrocki
` (2 more replies)
[not found] ` <1347879100-30150-1-git-send-email-s.nawrocki@samsung.com>
1 sibling, 3 replies; 6+ messages in thread
From: Sylwester Nawrocki @ 2012-09-17 10:54 UTC (permalink / raw)
To: linux-media
Cc: kyungmin.park, sw0312.kim, linux-samsung-soc, Sylwester Nawrocki
The phy_enable callback is common for all Samsung SoC platforms,
replace it with direct function call so the MIPI-CSI2 DPHY control
is also possible on device tree instantiated platforms.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/media/video/s5p-fimc/mipi-csis.c | 13 +++++++------
include/linux/platform_data/mipi-csis.h | 11 +++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/media/video/s5p-fimc/mipi-csis.c b/drivers/media/video/s5p-fimc/mipi-csis.c
index c9afb05..1a2db5d 100644
--- a/drivers/media/video/s5p-fimc/mipi-csis.c
+++ b/drivers/media/video/s5p-fimc/mipi-csis.c
@@ -150,6 +150,7 @@ static const struct s5pcsis_event s5pcsis_events[] = {
* protecting @format and @flags members
* @pads: CSIS pads array
* @sd: v4l2_subdev associated with CSIS device instance
+ * @index: the hardware instance index
* @pdev: CSIS platform device
* @regs: mmaped I/O registers memory
* @supplies: CSIS regulator supplies
@@ -165,6 +166,7 @@ struct csis_state {
struct mutex lock;
struct media_pad pads[CSIS_PADS_NUM];
struct v4l2_subdev sd;
+ u8 index;
struct platform_device *pdev;
void __iomem *regs;
struct regulator_bulk_data supplies[CSIS_NUM_SUPPLIES];
@@ -619,14 +621,15 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev)
spin_lock_init(&state->slock);
state->pdev = pdev;
+ state->index = max(0, pdev->id);
pdata = pdev->dev.platform_data;
- if (pdata == NULL || pdata->phy_enable == NULL) {
+ if (pdata == NULL) {
dev_err(&pdev->dev, "Platform data not fully specified\n");
return -EINVAL;
}
- if ((pdev->id == 1 && pdata->lanes > CSIS1_MAX_LANES) ||
+ if ((state->index == 1 && pdata->lanes > CSIS1_MAX_LANES) ||
pdata->lanes > CSIS0_MAX_LANES) {
dev_err(&pdev->dev, "Unsupported number of data lanes: %d\n",
pdata->lanes);
@@ -709,7 +712,6 @@ e_clkput:
static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
{
- struct s5p_platform_mipi_csis *pdata = dev->platform_data;
struct platform_device *pdev = to_platform_device(dev);
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csis_state *state = sd_to_csis_state(sd);
@@ -721,7 +723,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
mutex_lock(&state->lock);
if (state->flags & ST_POWERED) {
s5pcsis_stop_stream(state);
- ret = pdata->phy_enable(state->pdev, false);
+ ret = s5p_csis_phy_enable(state->index, false);
if (ret)
goto unlock;
ret = regulator_bulk_disable(CSIS_NUM_SUPPLIES,
@@ -740,7 +742,6 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
static int s5pcsis_pm_resume(struct device *dev, bool runtime)
{
- struct s5p_platform_mipi_csis *pdata = dev->platform_data;
struct platform_device *pdev = to_platform_device(dev);
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csis_state *state = sd_to_csis_state(sd);
@@ -758,7 +759,7 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime)
state->supplies);
if (ret)
goto unlock;
- ret = pdata->phy_enable(state->pdev, true);
+ ret = s5p_csis_phy_enable(state->index, true);
if (!ret) {
state->flags |= ST_POWERED;
} else {
diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h
index c45b1e8..2e59e43 100644
--- a/include/linux/platform_data/mipi-csis.h
+++ b/include/linux/platform_data/mipi-csis.h
@@ -11,8 +11,6 @@
#ifndef __PLAT_SAMSUNG_MIPI_CSIS_H_
#define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__
-struct platform_device;
-
/**
* struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver
* @clk_rate: bus clock frequency
@@ -34,10 +32,11 @@ struct s5p_platform_mipi_csis {
/**
* s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control
- * @pdev: MIPI-CSIS platform device
- * @on: true to enable D-PHY and deassert its reset
- * false to disable D-PHY
+ * @id: MIPI-CSIS harware instance index (0...1)
+ * @on: true to enable D-PHY and deassert its reset
+ * false to disable D-PHY
+ * @return: 0 on success, or negative error code on failure
*/
-int s5p_csis_phy_enable(struct platform_device *pdev, bool on);
+int s5p_csis_phy_enable(int id, bool on);
#endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */
--
1.7.11.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/7] s5p-fimc: Remove unused platform data structure fields
2012-09-17 10:54 ` [PATCH 4/7] s5p-csis: Replace phy_enable platform data callback with direct call Sylwester Nawrocki
@ 2012-09-17 10:54 ` Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 6/7] s5p-csis: Allow to specify pixel clock's source through platform data Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 7/7] s5p-csis: Change regulator supply names Sylwester Nawrocki
2 siblings, 0 replies; 6+ messages in thread
From: Sylwester Nawrocki @ 2012-09-17 10:54 UTC (permalink / raw)
To: linux-media
Cc: kyungmin.park, sw0312.kim, linux-samsung-soc, Sylwester Nawrocki
alignment, fixed_phy_vdd and phy_enable fields are now unused
so removed them. The data alignment is now derived directly
from media bus pixel code, phy_enable callback has been replaced
with direct function call and fixed_phy_vdd was dropped in commit
438df3ebe5f0ce408490a777a758d5905f0dd58f
"[media] s5p-csis: Handle all available power supplies".
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
include/linux/platform_data/mipi-csis.h | 15 ++++-----------
include/media/s5p_fimc.h | 2 --
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h
index 2e59e43..8b703e1 100644
--- a/include/linux/platform_data/mipi-csis.h
+++ b/include/linux/platform_data/mipi-csis.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
*
- * S5P series MIPI CSI slave device support
+ * Samsung S5P/Exynos SoC series MIPI CSIS device support
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -13,21 +13,14 @@
/**
* struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver
- * @clk_rate: bus clock frequency
- * @lanes: number of data lanes used
- * @alignment: data alignment in bits
- * @hs_settle: HS-RX settle time
- * @fixed_phy_vdd: false to enable external D-PHY regulator management in the
- * driver or true in case this regulator has no enable function
- * @phy_enable: pointer to a callback controlling D-PHY enable/reset
+ * @clk_rate: bus clock frequency
+ * @lanes: number of data lanes used
+ * @hs_settle: HS-RX settle time
*/
struct s5p_platform_mipi_csis {
unsigned long clk_rate;
u8 lanes;
- u8 alignment;
u8 hs_settle;
- bool fixed_phy_vdd;
- int (*phy_enable)(struct platform_device *pdev, bool on);
};
/**
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h
index 09421a61..eaea62a 100644
--- a/include/media/s5p_fimc.h
+++ b/include/media/s5p_fimc.h
@@ -30,7 +30,6 @@ struct i2c_board_info;
* @board_info: pointer to I2C subdevice's board info
* @clk_frequency: frequency of the clock the host interface provides to sensor
* @bus_type: determines bus type, MIPI, ITU-R BT.601 etc.
- * @csi_data_align: MIPI-CSI interface data alignment in bits
* @i2c_bus_num: i2c control bus id the sensor is attached to
* @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
* @clk_id: index of the SoC peripheral clock for sensors
@@ -40,7 +39,6 @@ struct s5p_fimc_isp_info {
struct i2c_board_info *board_info;
unsigned long clk_frequency;
enum cam_bus_type bus_type;
- u16 csi_data_align;
u16 i2c_bus_num;
u16 mux_id;
u16 flags;
--
1.7.11.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 6/7] s5p-csis: Allow to specify pixel clock's source through platform data
2012-09-17 10:54 ` [PATCH 4/7] s5p-csis: Replace phy_enable platform data callback with direct call Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 5/7] s5p-fimc: Remove unused platform data structure fields Sylwester Nawrocki
@ 2012-09-17 10:54 ` Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 7/7] s5p-csis: Change regulator supply names Sylwester Nawrocki
2 siblings, 0 replies; 6+ messages in thread
From: Sylwester Nawrocki @ 2012-09-17 10:54 UTC (permalink / raw)
To: linux-media
Cc: kyungmin.park, sw0312.kim, linux-samsung-soc, Sylwester Nawrocki
Depending on the sensor configuration it might be required to adjust
the CSIS's output pixel clock so it is greater than its input pixel
clock, in order to avoid the input data FIFO overflow.
Use platform data to select SCLK_CSIS clock from CMU as a source, rather
than CSI APB clock.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/media/video/s5p-fimc/mipi-csis.c | 4 +++-
include/linux/platform_data/mipi-csis.h | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/media/video/s5p-fimc/mipi-csis.c b/drivers/media/video/s5p-fimc/mipi-csis.c
index 1a2db5d..fbfe739 100644
--- a/drivers/media/video/s5p-fimc/mipi-csis.c
+++ b/drivers/media/video/s5p-fimc/mipi-csis.c
@@ -306,8 +306,10 @@ static void s5pcsis_set_params(struct csis_state *state)
val |= S5PCSIS_CTRL_ALIGN_32BIT;
else /* 24-bits */
val &= ~S5PCSIS_CTRL_ALIGN_32BIT;
- /* Not using external clock. */
+
val &= ~S5PCSIS_CTRL_WCLK_EXTCLK;
+ if (pdata->wclk_source)
+ val |= S5PCSIS_CTRL_WCLK_EXTCLK;
s5pcsis_write(state, S5PCSIS_CTRL, val);
/* Update the shadow register. */
diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h
index 8b703e1..bf34e17 100644
--- a/include/linux/platform_data/mipi-csis.h
+++ b/include/linux/platform_data/mipi-csis.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
+ * Copyright (C) 2010 - 2012 Samsung Electronics Co., Ltd.
*
* Samsung S5P/Exynos SoC series MIPI CSIS device support
*
@@ -14,11 +14,13 @@
/**
* struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver
* @clk_rate: bus clock frequency
+ * @wclk_source: CSI wrapper clock selection: 0 - bus clock, 1 - ext. SCLK_CAM
* @lanes: number of data lanes used
* @hs_settle: HS-RX settle time
*/
struct s5p_platform_mipi_csis {
unsigned long clk_rate;
+ u8 wclk_source;
u8 lanes;
u8 hs_settle;
};
--
1.7.11.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 7/7] s5p-csis: Change regulator supply names
2012-09-17 10:54 ` [PATCH 4/7] s5p-csis: Replace phy_enable platform data callback with direct call Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 5/7] s5p-fimc: Remove unused platform data structure fields Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 6/7] s5p-csis: Allow to specify pixel clock's source through platform data Sylwester Nawrocki
@ 2012-09-17 10:54 ` Sylwester Nawrocki
2 siblings, 0 replies; 6+ messages in thread
From: Sylwester Nawrocki @ 2012-09-17 10:54 UTC (permalink / raw)
To: linux-media
Cc: kyungmin.park, sw0312.kim, linux-samsung-soc, Sylwester Nawrocki
Rename the regulator supply names to more meaningful ones.
It's a prerequisite for adding device tree support.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/media/video/s5p-fimc/mipi-csis.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/video/s5p-fimc/mipi-csis.c b/drivers/media/video/s5p-fimc/mipi-csis.c
index fbfe739..4bf7a68 100644
--- a/drivers/media/video/s5p-fimc/mipi-csis.c
+++ b/drivers/media/video/s5p-fimc/mipi-csis.c
@@ -2,7 +2,7 @@
* Samsung S5P/EXYNOS4 SoC series MIPI-CSI receiver driver
*
* Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd.
- * Sylwester Nawrocki, <s.nawrocki@samsung.com>
+ * Sylwester Nawrocki <s.nawrocki@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -110,8 +110,8 @@ static char *csi_clock_name[] = {
#define NUM_CSIS_CLOCKS ARRAY_SIZE(csi_clock_name)
static const char * const csis_supply_name[] = {
- "vdd11", /* 1.1V or 1.2V (s5pc100) MIPI CSI suppply */
- "vdd18", /* VDD 1.8V and MIPI CSI PLL supply */
+ "vddcore", /* CSIS Core (1.0V, 1.1V or 1.2V) suppply */
+ "vddio", /* CSIS I/O and PLL (1.8V) supply */
};
#define CSIS_NUM_SUPPLIES ARRAY_SIZE(csis_supply_name)
--
1.7.11.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/7] ARM: samsung: Remove unused fields from FIMC and CSIS platform data
[not found] ` <050d01cd94c3$f39c4210$dad4c630$%kim@samsung.com>
@ 2012-09-17 11:24 ` Sylwester Nawrocki
0 siblings, 0 replies; 6+ messages in thread
From: Sylwester Nawrocki @ 2012-09-17 11:24 UTC (permalink / raw)
To: Kukjin Kim, linux-media
Cc: linux-arm-kernel, kyungmin.park, sw0312.kim, linux-samsung-soc,
Mauro Carvalho Chehab
On 09/17/2012 01:02 PM, Kukjin Kim wrote:
> Sylwester Nawrocki wrote:
>>
>> The MIPI-CSI2 bus data alignment is now being derived from the media
>> bus pixel code, the drivers don't use the corresponding structure
>> fields, so remove them. Also remove the s5p_csis_phy_enable callback
>> which is now used directly by s5p-csis driver.
>>
>> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>
> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Thank you for your ack on these three first patches, I'll then ask
Mauro to push it upstream through his tree. As he usually sends
his patches out late during merge window, there should hopefully
be no merge conflicts.
Regards,
--
Sylwester Nawrocki
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-09-17 11:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 10:48 [PATCH 0/7] s5p-fimc/mipi-csis drivers cleanup Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 4/7] s5p-csis: Replace phy_enable platform data callback with direct call Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 5/7] s5p-fimc: Remove unused platform data structure fields Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 6/7] s5p-csis: Allow to specify pixel clock's source through platform data Sylwester Nawrocki
2012-09-17 10:54 ` [PATCH 7/7] s5p-csis: Change regulator supply names Sylwester Nawrocki
[not found] ` <1347879100-30150-1-git-send-email-s.nawrocki@samsung.com>
[not found] ` <050d01cd94c3$f39c4210$dad4c630$%kim@samsung.com>
2012-09-17 11:24 ` [PATCH 1/7] ARM: samsung: Remove unused fields from FIMC and CSIS platform data Sylwester Nawrocki
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).