diff options
author | Josh Wu <josh.wu@atmel.com> | 2014-07-25 06:13:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-30 18:47:19 -0400 |
commit | 833e1063266ebbf75934f1171c6546cdf33e9848 (patch) | |
tree | 61fb816312b1d61a5a6b579cc0970376dfb8ef6a /drivers/media/platform | |
parent | 3900623bfaffde4eeb93ca0ba0475598a1b0cef5 (diff) |
[media] media: atmel-isi: convert the pdata from pointer to structure
Now the platform data is initialized by allocation of isi
structure. In the future, we use pdata to store the dt parameters.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/soc_camera/atmel-isi.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c index c0d46128cad9..d32c53383565 100644 --- a/drivers/media/platform/soc_camera/atmel-isi.c +++ b/drivers/media/platform/soc_camera/atmel-isi.c | |||
@@ -84,7 +84,7 @@ struct atmel_isi { | |||
84 | struct clk *mck; | 84 | struct clk *mck; |
85 | unsigned int irq; | 85 | unsigned int irq; |
86 | 86 | ||
87 | struct isi_platform_data *pdata; | 87 | struct isi_platform_data pdata; |
88 | u16 width_flags; /* max 12 bits */ | 88 | u16 width_flags; /* max 12 bits */ |
89 | 89 | ||
90 | struct list_head video_buffer_list; | 90 | struct list_head video_buffer_list; |
@@ -350,7 +350,7 @@ static void start_dma(struct atmel_isi *isi, struct frame_buffer *buffer) | |||
350 | 350 | ||
351 | cfg1 &= ~ISI_CFG1_FRATE_DIV_MASK; | 351 | cfg1 &= ~ISI_CFG1_FRATE_DIV_MASK; |
352 | /* Enable linked list */ | 352 | /* Enable linked list */ |
353 | cfg1 |= isi->pdata->frate | ISI_CFG1_DISCR; | 353 | cfg1 |= isi->pdata.frate | ISI_CFG1_DISCR; |
354 | 354 | ||
355 | /* Enable codec path and ISI */ | 355 | /* Enable codec path and ISI */ |
356 | ctrl = ISI_CTRL_CDC | ISI_CTRL_EN; | 356 | ctrl = ISI_CTRL_CDC | ISI_CTRL_EN; |
@@ -795,7 +795,7 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) | |||
795 | /* Make choises, based on platform preferences */ | 795 | /* Make choises, based on platform preferences */ |
796 | if ((common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) && | 796 | if ((common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) && |
797 | (common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)) { | 797 | (common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)) { |
798 | if (isi->pdata->hsync_act_low) | 798 | if (isi->pdata.hsync_act_low) |
799 | common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_HIGH; | 799 | common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_HIGH; |
800 | else | 800 | else |
801 | common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_LOW; | 801 | common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_LOW; |
@@ -803,7 +803,7 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) | |||
803 | 803 | ||
804 | if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) && | 804 | if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) && |
805 | (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) { | 805 | (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) { |
806 | if (isi->pdata->vsync_act_low) | 806 | if (isi->pdata.vsync_act_low) |
807 | common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH; | 807 | common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH; |
808 | else | 808 | else |
809 | common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW; | 809 | common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW; |
@@ -811,7 +811,7 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) | |||
811 | 811 | ||
812 | if ((common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) && | 812 | if ((common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) && |
813 | (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)) { | 813 | (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)) { |
814 | if (isi->pdata->pclk_act_falling) | 814 | if (isi->pdata.pclk_act_falling) |
815 | common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_RISING; | 815 | common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_RISING; |
816 | else | 816 | else |
817 | common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_FALLING; | 817 | common_flags &= ~V4L2_MBUS_PCLK_SAMPLE_FALLING; |
@@ -833,9 +833,9 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) | |||
833 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING) | 833 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING) |
834 | cfg1 |= ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING; | 834 | cfg1 |= ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING; |
835 | 835 | ||
836 | if (isi->pdata->has_emb_sync) | 836 | if (isi->pdata.has_emb_sync) |
837 | cfg1 |= ISI_CFG1_EMB_SYNC; | 837 | cfg1 |= ISI_CFG1_EMB_SYNC; |
838 | if (isi->pdata->full_mode) | 838 | if (isi->pdata.full_mode) |
839 | cfg1 |= ISI_CFG1_FULL_MODE; | 839 | cfg1 |= ISI_CFG1_FULL_MODE; |
840 | 840 | ||
841 | isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); | 841 | isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); |
@@ -903,7 +903,7 @@ static int atmel_isi_probe(struct platform_device *pdev) | |||
903 | if (IS_ERR(isi->pclk)) | 903 | if (IS_ERR(isi->pclk)) |
904 | return PTR_ERR(isi->pclk); | 904 | return PTR_ERR(isi->pclk); |
905 | 905 | ||
906 | isi->pdata = pdata; | 906 | memcpy(&isi->pdata, pdata, sizeof(isi->pdata)); |
907 | isi->active = NULL; | 907 | isi->active = NULL; |
908 | spin_lock_init(&isi->lock); | 908 | spin_lock_init(&isi->lock); |
909 | INIT_LIST_HEAD(&isi->video_buffer_list); | 909 | INIT_LIST_HEAD(&isi->video_buffer_list); |
@@ -919,7 +919,7 @@ static int atmel_isi_probe(struct platform_device *pdev) | |||
919 | /* Set ISI_MCK's frequency, it should be faster than pixel | 919 | /* Set ISI_MCK's frequency, it should be faster than pixel |
920 | * clock. | 920 | * clock. |
921 | */ | 921 | */ |
922 | ret = clk_set_rate(isi->mck, pdata->mck_hz); | 922 | ret = clk_set_rate(isi->mck, isi->pdata.mck_hz); |
923 | if (ret < 0) | 923 | if (ret < 0) |
924 | return ret; | 924 | return ret; |
925 | } | 925 | } |
@@ -953,9 +953,9 @@ static int atmel_isi_probe(struct platform_device *pdev) | |||
953 | goto err_ioremap; | 953 | goto err_ioremap; |
954 | } | 954 | } |
955 | 955 | ||
956 | if (pdata->data_width_flags & ISI_DATAWIDTH_8) | 956 | if (isi->pdata.data_width_flags & ISI_DATAWIDTH_8) |
957 | isi->width_flags = 1 << 7; | 957 | isi->width_flags = 1 << 7; |
958 | if (pdata->data_width_flags & ISI_DATAWIDTH_10) | 958 | if (isi->pdata.data_width_flags & ISI_DATAWIDTH_10) |
959 | isi->width_flags |= 1 << 9; | 959 | isi->width_flags |= 1 << 9; |
960 | 960 | ||
961 | isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); | 961 | isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); |