Skip to content

Commit

Permalink
V4L/DVB (13661): rj54n1cb0c: Add cropping, auto white balance, restri…
Browse files Browse the repository at this point in the history
…ct sizes, add platform data

It has been experimentally found out, that the sensor only supports up to
512x384 video output and also has some restrictions on minimum scale. We
disable non-working size ranges until, maybe, someone finds out how to properly
set them up. Also add cropping support, an auto white balance control, platform
data to specify master clock frequency and polarity of the IOCTL pin.

 create mode 100644 include/media/rj54n1cb0c.h

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Dec 16, 2009
1 parent 760697b commit a6b5f20
Show file tree
Hide file tree
Showing 3 changed files with 261 additions and 48 deletions.
13 changes: 11 additions & 2 deletions arch/sh/boards/mach-kfr2r09/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/input/sh_keysc.h>
#include <linux/i2c.h>
#include <linux/usb/r8a66597.h>
#include <media/rj54n1cb0c.h>
#include <media/soc_camera.h>
#include <media/sh_mobile_ceu.h>
#include <video/sh_mobile_lcdc.h>
Expand Down Expand Up @@ -255,6 +256,9 @@ static struct i2c_board_info kfr2r09_i2c_camera = {

static struct clk *camera_clk;

/* set VIO_CKO clock to 25MHz */
#define CEU_MCLK_FREQ 25000000

#define DRVCRB 0xA405018C
static int camera_power(struct device *dev, int mode)
{
Expand All @@ -267,8 +271,7 @@ static int camera_power(struct device *dev, int mode)
if (IS_ERR(camera_clk))
return PTR_ERR(camera_clk);

/* set VIO_CKO clock to 25MHz */
rate = clk_round_rate(camera_clk, 25000000);
rate = clk_round_rate(camera_clk, CEU_MCLK_FREQ);
ret = clk_set_rate(camera_clk, rate);
if (ret < 0)
goto eclkrate;
Expand Down Expand Up @@ -318,11 +321,17 @@ static int camera_power(struct device *dev, int mode)
return ret;
}

static struct rj54n1_pdata rj54n1_priv = {
.mclk_freq = CEU_MCLK_FREQ,
.ioctl_high = false,
};

static struct soc_camera_link rj54n1_link = {
.power = camera_power,
.board_info = &kfr2r09_i2c_camera,
.i2c_adapter_id = 1,
.module_name = "rj54n1cb0c",
.priv = &rj54n1_priv,
};

static struct platform_device kfr2r09_camera = {
Expand Down
Loading

0 comments on commit a6b5f20

Please sign in to comment.