Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137942
b: refs/heads/master
c: c354b40
h: refs/heads/master
v: v3
  • Loading branch information
Kuninori Morimoto authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 7c1f1de commit e06546f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1af1b7a2def2f0936fc95edb5dcb3871934b7852
refs/heads/master: c354b400c0eac1cc0009958754797538857ce640
28 changes: 26 additions & 2 deletions trunk/drivers/media/video/sh_mobile_ceu_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,30 @@ struct sh_mobile_ceu_dev {
const struct soc_camera_data_format *camera_fmt;
};

static unsigned long make_bus_param(struct sh_mobile_ceu_dev *pcdev)
{
unsigned long flags;

flags = SOCAM_MASTER |
SOCAM_PCLK_SAMPLE_RISING |
SOCAM_HSYNC_ACTIVE_HIGH |
SOCAM_HSYNC_ACTIVE_LOW |
SOCAM_VSYNC_ACTIVE_HIGH |
SOCAM_VSYNC_ACTIVE_LOW |
SOCAM_DATA_ACTIVE_HIGH;

if (pcdev->pdata->flags & SH_CEU_FLAG_USE_8BIT_BUS)
flags |= SOCAM_DATAWIDTH_8;

if (pcdev->pdata->flags & SH_CEU_FLAG_USE_16BIT_BUS)
flags |= SOCAM_DATAWIDTH_16;

if (flags & SOCAM_DATAWIDTH_MASK)
return flags;

return 0;
}

static void ceu_write(struct sh_mobile_ceu_dev *priv,
unsigned long reg_offs, u32 data)
{
Expand Down Expand Up @@ -396,7 +420,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd,

camera_flags = icd->ops->query_bus_param(icd);
common_flags = soc_camera_bus_param_compatible(camera_flags,
pcdev->pdata->flags);
make_bus_param(pcdev));
if (!common_flags)
return -EINVAL;

Expand Down Expand Up @@ -517,7 +541,7 @@ static int sh_mobile_ceu_try_bus_param(struct soc_camera_device *icd)

camera_flags = icd->ops->query_bus_param(icd);
common_flags = soc_camera_bus_param_compatible(camera_flags,
pcdev->pdata->flags);
make_bus_param(pcdev));
if (!common_flags)
return -EINVAL;

Expand Down
5 changes: 3 additions & 2 deletions trunk/include/media/sh_mobile_ceu.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#ifndef __ASM_SH_MOBILE_CEU_H__
#define __ASM_SH_MOBILE_CEU_H__

#include <media/soc_camera.h>
#define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */
#define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */

struct sh_mobile_ceu_info {
unsigned long flags; /* SOCAM_... */
unsigned long flags;
};

#endif /* __ASM_SH_MOBILE_CEU_H__ */

0 comments on commit e06546f

Please sign in to comment.