aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWerner Almesberger <werner@openmoko.org>2009-03-05 14:39:54 +0000
committerAndy Green <agreen@octopus.localdomain>2009-03-05 14:39:54 +0000
commit01ca50a5b8b0e1feb9cff8d93314e87a91f09efe (patch)
tree919c82e2c6c8a788a727ca694e67f9bab83aa93a /drivers
parent33a321349df772925a696cb454f28e8119d7a554 (diff)
Fix Samsung S5K4BA camera driver.
This patch makes the Samsung S5K4BA driver work in 2.6.29 and also solves a few minor issues, such as trailing whitespace. Signed-off-by: Werner Almesberger <werner@openmoko.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/samsung/4xa_sensor.c18
-rw-r--r--drivers/media/video/samsung/4xa_sensor.h147
-rw-r--r--drivers/media/video/samsung/Makefile6
3 files changed, 81 insertions, 90 deletions
diff --git a/drivers/media/video/samsung/4xa_sensor.c b/drivers/media/video/samsung/4xa_sensor.c
index de398edcc69..60259540ac8 100644
--- a/drivers/media/video/samsung/4xa_sensor.c
+++ b/drivers/media/video/samsung/4xa_sensor.c
@@ -102,16 +102,13 @@ camif_cis_t* get_initialized_cis(void)
static unsigned short ignore[] = { I2C_CLIENT_END };
static unsigned short normal_addr[] = { (CAM_ID >> 1), I2C_CLIENT_END };
-static unsigned short *forces[] = { NULL };
+static const unsigned short *forces[] = { NULL };
static struct i2c_client_address_data addr_data = {
- normal_i2c:normal_addr,
- /* normal_i2c_range:ignore, */
- probe:ignore,
- /* probe_range:ignore, */
- ignore:ignore,
- /* ignore_range:ignore, */
- forces:forces,
+ .normal_i2c = normal_addr,
+ .probe = ignore,
+ .ignore = ignore,
+ .forces = forces,
};
@@ -171,13 +168,13 @@ s5k4xa_attach(struct i2c_adapter *adap, int addr, int kind)
if (!c)
return -ENOMEM;
- memset(c, 0, sizeof(struct i2c_client));
+ memset(c, 0, sizeof(struct i2c_client));
strcpy(c->name, "S5K4XA");
c->addr = addr;
c->adapter = adap;
c->driver = &sensor_driver;
- c->data = &data;
+ i2c_set_clientdata(c, &data);
data.sensor = c;
s3c_camif_register_sensor(c);
@@ -346,4 +343,3 @@ module_exit(camif_sensor_exit)
MODULE_AUTHOR("Jinsung, Yang <jsgood.yang@samsung.com>");
MODULE_DESCRIPTION("I2C Client Driver For FIMC V4L2 Driver");
MODULE_LICENSE("GPL");
-
diff --git a/drivers/media/video/samsung/4xa_sensor.h b/drivers/media/video/samsung/4xa_sensor.h
index 9880f6c7db3..8d571a654bd 100644
--- a/drivers/media/video/samsung/4xa_sensor.h
+++ b/drivers/media/video/samsung/4xa_sensor.h
@@ -168,10 +168,10 @@ s5k4xa_t s5k4ba_reg[] =
{0xfc,0x00},
{0x6c,0xb0}, // AE target
{0x6d,0x00},
-
+
{0xfc,0x20},
{0x16,0x5a}, // for Prevating AE Hunting
-
+
{0xfc,0x00},
{0x78,0x6a}, // AGC Max
{0xfc,0x20},
@@ -186,10 +186,10 @@ s5k4xa_t s5k4ba_reg[] =
{0xfc,0x07},
{0x11,0x02}, // AWB G Gain offset
-
+
{0xfc,0x07},
{0x3e,0x0a}, // AWB Cut R max
-
+
{0xfc,0x01},
{0xc8,0xd0}, // AWB Y Max e0 Y°ªÀÌ ¾î´À ÀÌ»óÀ϶§ ±× ÀÌ»ó°ªÀ» ©¶ó³»´Â ¼¼Æðª
{0xfc,0x00},
@@ -203,12 +203,12 @@ s5k4xa_t s5k4ba_reg[] =
{0x32,0x04}, // AWB moving average 8 frame
{0x81,0x10}, // AWB G gain suppress Disable
{0xbc,0xf0},
-
+
{0x29,0x04}, // Y level H
{0x2a,0x00}, // Y level L
{0x2b,0x03}, // color level H
{0x2c,0xc8}, // color level L
-
+
{0xfc,0x07},
{0x37,0x00}, // Flicker Add for 32Mhz
{0xfc,0x00},
@@ -217,11 +217,11 @@ s5k4xa_t s5k4ba_reg[] =
{0xfc,0x20},
{0x02,0x02}, // Flicker Dgain Mode
-
+
{0xfc,0x00},
//{0x23,0x40}, // Mirror Option
- {0x62,0x0a}, // Mirror Option
-
+ {0x62,0x0a}, // Mirror Option
+
{0xfc,0x02},
{0x4e,0x00}, // IO current 8mA set
{0x4e,0x00}, // IO current 8mA set
@@ -231,7 +231,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x4f,0x0a}, // IO current 48mA set
{0x4f,0x0a}, // IO current 48mA set
{0x4f,0x0a}, // IO current 48mA set
-
+
{0xfc,0x01},
{0x0c,0x03}, // Full YC Enable
//{0x0c,03}, // Full YC Enable
@@ -261,7 +261,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x5D,0xFF},
{0x5E,0xD8},
{0x5F,0xFC},
- {0x60,0x2E},
+ {0x60,0x2E},
{0x61,0x07},
{0x62,0xFA},
@@ -277,7 +277,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x49,0x0a}, // positive gain AGC MAX
{0x4d,0x18}, // negative gain AGC MIN
{0x51,0x0a}, // negative gain AGC MAX
-
+
{0xfc,0x05},
{0x34,0x20}, // APTCLP
{0x35,0x09}, // APTSC
@@ -290,7 +290,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x47,0x40}, // LLREF
{0x48,0x0c},
{0x49,0x31}, // CSSEL EGSEL CS_DLY
-
+
{0x40,0x41}, // Y delay
//==========================================================
@@ -323,14 +323,14 @@ s5k4xa_t s5k4ba_reg[] =
{0x82,0xFF},
{0x83,0xC0},
- {0x84,0xCF},
- {0x85,0xDA},
+ {0x84,0xCF},
+ {0x85,0xDA},
{0x86,0xFC},
{0x87,0x08}, //G
{0x88,0x12},
- {0x89,0x42},
- {0x8A,0xBA},
+ {0x89,0x42},
+ {0x8A,0xBA},
{0x8B,0x00},
{0x8C,0x75},
@@ -359,7 +359,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x9F,0x05}, //B
{0xA0,0x18},
{0xA1,0x42},
- {0xA2,0xd7},
+ {0xA2,0xd7},
{0xA3,0x00},
{0xA4,0xB6},
@@ -397,7 +397,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x4d,0x3c},
{0x4e,0xf0},
{0x4f,0x0c},
-
+
{0x50,0x34}, // 3000K
{0x51,0x34},
{0x52,0xf4},
@@ -406,7 +406,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x55,0x3c},
{0x56,0xf0},
{0x57,0x0c},
-
+
{0x58,0x34}, // 5100K
{0x59,0x30},
{0x5a,0x00},
@@ -420,13 +420,13 @@ s5k4xa_t s5k4ba_reg[] =
//==========================================================
{0xfc,0x00},
{0x7e,0xf4},
-
+
//==========================================================
// BPR
//==========================================================
{0xfc,0x01},
{0x3d,0x10},
-
+
{0xfc,0x0b},
{0x0b,0x00}, // ISP BPR On start
{0x0c,0x20}, // Th13 AGC Min
@@ -454,8 +454,8 @@ s5k4xa_t s5k4ba_reg[] =
// GR/GB CORRECTION
//==========================================================
{0xfc,0x01},
- {0x45,0x0c},
-
+ {0x45,0x0c},
+
{0xfc,0x0b},
{0x21,0x00}, // start AGC
{0x22,0x18}, // AGCMIN
@@ -464,7 +464,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x25,0x30}, // G Th AGCMAX
{0x26,0x0d}, // RB Th AGCMIN
{0x27,0x30}, // RB Th AGCMAX
-
+
//==========================================================
// NR
//==========================================================
@@ -472,9 +472,9 @@ s5k4xa_t s5k4ba_reg[] =
{0x4C,0x01}, // NR Enable
{0x49,0x15}, // Sig_Th Mult
{0x4B,0x0A}, // Pre_Th Mult
-
+
{0xfc,0x0b},
- {0x28,0x00}, // NR start AGC
+ {0x28,0x00}, // NR start AGC
{0x29,0x00}, // SIG Th AGCMIN H
{0x2a,0x14}, // SIG Th AGCMIN L
{0x2b,0x00}, // SIG Th AGCMAX H
@@ -487,13 +487,13 @@ s5k4xa_t s5k4ba_reg[] =
{0x32,0xa0}, // POST Th AGCMIN L
{0x33,0x01}, // POST Th AGCMAX H
{0x34,0x10}, // POST Th AGCMAX L
-
+
//==========================================================
// 1D-Y/C-SIGMA-LPF
//==========================================================
{0xfc,0x01},
- {0x05,0xc0},
-
+ {0x05,0xc0},
+
{0xfc,0x0b},
{0x35,0x00}, // YLPF start AGC
{0x36,0x40}, // YLPF01 AGCMIN
@@ -522,7 +522,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x08,0x58}, // Color suppress AGC MIN
{0x09,0x03}, // Color suppress MIN H
{0x0a,0x80}, // Color suppress MIN L
-
+
//==========================================================
// SHADING
//==========================================================
@@ -832,10 +832,10 @@ s5k4xa_t s5k4ba_reg[] =
{0xdb,0xac},
{0xdc,0x01}, // tc(5100K)
{0xdd,0x30}, // default eeh
-
+
{0xfc,0x00},
{0x81,0x10}, // xshading tem
-
+
{0xfc,0x1b},
{0x80,0x01}, // X-Shading On
@@ -844,7 +844,7 @@ s5k4xa_t s5k4ba_reg[] =
//==========================================================
{0xfc,0x00},
{0x03,0x4b}, // AE Suppress On
-
+
{0xfc,0x06},
{0x01,0x35}, // UXGA AE Window
{0x03,0xc2},
@@ -858,7 +858,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x3B,0x5A},
{0x3D,0x10}, // 1c
{0x3F,0x44},
-
+
{0xfc,0x20},
{0x60,0x11},
{0x61,0x11},
@@ -927,7 +927,7 @@ s5k4xa_t s5k4ba_reg[] =
{0xAE,0x2C},
{0xAF,0x19},
{0xB0,0x0F},
-
+
{0x94,0x3C},
{0x95,0xCC},
{0x96,0x5C},
@@ -948,13 +948,13 @@ s5k4xa_t s5k4ba_reg[] =
{0xEB,0x00},
{0xEC,0x00},
{0xEE,0x97},
-
+
//=================================
// Pixel Filter Setting
//=================================
{0xFC,0x07},
{0x95,0x8F},
-
+
{0xfc,0x01},
{0xD3,0x4B},
{0xD4,0x00},
@@ -1043,12 +1043,12 @@ s5k4xa_t s5k4ba_reg[] =
{0xb2,0x03},
{0xb3,0x00},
{0xb4,0xc1},
-
+
{0xb5,0x00}, // Cloudy
{0xb6,0x05},
{0xb7,0xc9},
{0xb9,0x81},
-
+
{0xd7,0x00}, // Shade
{0xd8,0x35},
{0xd9,0x20},
@@ -1060,7 +1060,7 @@ s5k4xa_t s5k4ba_reg[] =
{0xfc,0x00},
{0x79,0xF9},
{0x7A,0x02}, // Global AWB gain off{0xet
-
+
{0xfc,0x22},
{0x58,0xf6}, // D65 R Off{0xet
{0x59,0xff}, // D65 B Off{0xet
@@ -1074,7 +1074,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x61,0xfb}, // A B Off0xet
{0x62,0xfb}, // 2000K R Off0xet
{0x63,0xfb}, // 2000K B Off0xet
-
+
{0xde,0x00}, // LARGE OBJECT BUG FIX
{0xf0,0x6a}, // RB Ratio
//=================================
@@ -1265,7 +1265,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x5f, 0xfc}, //fd //FC FB
{0x60, 0x96}, //5b //23 B1
{0x61, 0x07}, //07 //08 08
- {0x62, 0xaf}, //24 //64 FD
+ {0x62, 0xaf}, //24 //64 FD
//==========================================================
// EDGE ENHANCEMENT
@@ -1560,7 +1560,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x1e, 0x00},
{0x1f, 0x20},
-//==========================================================
+//==========================================================
// GR/GB CORRECTION
//==========================================================
{0xfc, 0x01},
@@ -1602,7 +1602,7 @@ s5k4xa_t s5k4ba_reg[] =
//==========================================================
{0xfc, 0x01},
{0x05, 0xC0},
-
+
{0xfc, 0x0b},
{0x35, 0x00},
{0x36, 0x40},
@@ -1642,22 +1642,22 @@ s5k4xa_t s5k4ba_reg[] =
{0x03, 0x04},
{0x04, 0xB0},
-
+
{0x05, 0x03},
{0x06, 0x20},
{0x07, 0x02},
{0x08, 0x91},
-
+
{0x09, 0x03},
{0x0A, 0x25},
{0x0B, 0x02},
{0x0C, 0x64},
-
+
{0x0D, 0x03},
{0x0E, 0x0F},
{0x0F, 0x02},
{0x10, 0x4E},
-
+
{0x1D, 0x80},
{0x1E, 0x00},
{0x1F, 0x80},
@@ -1666,7 +1666,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x24, 0x52},
{0x21, 0x79},
{0x22, 0xE6},
-
+
{0x25, 0x80},
{0x26, 0x00},
{0x27, 0x80},
@@ -1675,7 +1675,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x2C, 0x48},
{0x29, 0x81},
{0x2A, 0x48},
-
+
{0x2D, 0x80},
{0x2E, 0x00},
{0x2F, 0x80},
@@ -1701,7 +1701,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x42, 0x6A},
{0x43, 0x02},
{0x44, 0xD3},
-
+
{0x45, 0x01},
{0x46, 0x00},
{0x47, 0x01},
@@ -1846,7 +1846,7 @@ s5k4xa_t s5k4ba_reg[] =
{0xCB, 0x49},
{0xCC, 0x15},
{0xCD, 0xBA},
-
+
{0x00, 0x02},// shading on
//==========================================================
@@ -1933,13 +1933,13 @@ s5k4xa_t s5k4ba_reg[] =
{0xD3, 0x84},
{0xD4, 0x06},
{0xD5, 0xCA},
-
+
{0xfc, 0x0b},
{0xda, 0x00},
{0xdb, 0x9c},
{0xdc, 0x00},
{0xdd, 0xd1},
-
+
{0xfc, 0x1b},
{0x80, 0x01},
@@ -1957,7 +1957,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x33, 0x61},
{0x35, 0x28},
{0x37, 0x5c},
-
+
{0xfc, 0x20},
{0x60, 0x11},
{0x61, 0x11},
@@ -1989,18 +1989,18 @@ s5k4xa_t s5k4ba_reg[] =
//==========================================================
{0xfc, 0x00},
{0x7b, 0x00},
-
+
{0xfc, 0x07},
{0x3c, 0x10},
{0x3d, 0x10},
{0x3e, 0x10},
{0x3f, 0x10},
-
+
{0xfc, 0x01},
{0xc8, 0xe0},
{0xfc, 0x00},
{0x3e, 0x10},
-
+
{0xfc, 0x00},
{0x3e, 0x10},
{0x3d, 0x04},
@@ -2010,7 +2010,7 @@ s5k4xa_t s5k4ba_reg[] =
{0xfc, 0x22},
{0x8c, 0x04},
{0x8d, 0x06},
-
+
{0xfc, 0x07},
{0x97, 0x00},
@@ -2038,7 +2038,7 @@ s5k4xa_t s5k4ba_reg[] =
//=================================
{0xfc, 0x22},
{0xA8, 0xFF},
-
+
{0xA0, 0x01},
{0xA1, 0x38},
{0xA2, 0x0E},
@@ -2074,7 +2074,7 @@ s5k4xa_t s5k4ba_reg[] =
{0xEB, 0xD2},
{0xEC, 0xD9},
{0xEE, 0xA6},
-
+
{0xfc, 0x00},
{0x8a, 0x02},
@@ -2083,7 +2083,7 @@ s5k4xa_t s5k4ba_reg[] =
//=================================
{0xFC, 0x07},
{0x95, 0xCF},
-
+
{0xfc, 0x01},
{0xd3, 0x4f},
{0xd4, 0x00},
@@ -2174,12 +2174,12 @@ s5k4xa_t s5k4ba_reg[] =
{0xb2, 0x02},
{0xb3, 0x00},
{0xb4, 0xC1},
-
+
{0xb5, 0x00},
{0xb6, 0x02},
{0xb7, 0x00},
{0xb9, 0xc2},
-
+
{0xd7, 0x00},
{0xd8, 0x35},
{0xd9, 0x20},
@@ -2191,10 +2191,10 @@ s5k4xa_t s5k4ba_reg[] =
{0xfc, 0x00},
{0x79, 0xf8},
{0x7a, 0x08},
-
+
{0xfc, 0x07},
{0x11, 0x01},
-
+
{0xfc, 0x22},
{0x58, 0xf8},
{0x59, 0x00},
@@ -2208,7 +2208,7 @@ s5k4xa_t s5k4ba_reg[] =
{0x61, 0xf8},
{0x62, 0x00},
{0x63, 0xf0},
-
+
{0xde, 0x00},
{0xf0, 0x6a},
@@ -2243,13 +2243,13 @@ s5k4xa_t s5k4ba_reg[] =
{0x00, 0x90},
{0xfc, 0x02},
{0x03, 0x20},
-
+
{0xfc, 0x20},
{0x0f, 0x00},
-
+
{0xfc, 0x00},
{0x02, 0x09},
-
+
{0xfc, 0x01},
//{0x02, 0x00},
{0x02, 0x02},//Donghoon
@@ -2300,9 +2300,9 @@ s5k4xa_t s5k4ba_reg_svga[] =
{0x9F,0x05}, //B
{0xA0,0x18},
{0xA1,0x42},
- {0xA2,0xd7},
+ {0xA2,0xd7},
{0xA3,0x00},
-
+
{0xA4,0xB6},
{0xA5,0x3b},
{0xA6,0x88},
@@ -2374,4 +2374,3 @@ s5k4xa_t s5k4ba_reg_qsvga[] =
#endif
-
diff --git a/drivers/media/video/samsung/Makefile b/drivers/media/video/samsung/Makefile
index 800fcefeabf..b948d9f94ee 100644
--- a/drivers/media/video/samsung/Makefile
+++ b/drivers/media/video/samsung/Makefile
@@ -1,8 +1,4 @@
#
# Samsung CIS camera module
-
-obj-$(CONFIG_VIDEO_SAMSUNG_S5K3AA) += 3xa_sensor.o
-obj-$(CONFIG_VIDEO_SAMSUNG_S5K3BA) += 3xa_sensor.o
+#
obj-$(CONFIG_VIDEO_SAMSUNG_S5K4BA) += 4xa_sensor.o
-obj-$(CONFIG_VIDEO_SAMSUNG_S5K53BA) += 53bea_sensor.o
-obj-$(CONFIG_VIDEO_ADV7180) += adv7180.o