Commit dffbdf37 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: ccs: Switch from standard integer types to kernel ones

The preferred integer types in the kernel are the Linux specific ones,
switch from standard C types to u32 and alike.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 8a75e8dc
...@@ -1190,7 +1190,7 @@ static void ccs_update_blanking(struct ccs_sensor *sensor) ...@@ -1190,7 +1190,7 @@ static void ccs_update_blanking(struct ccs_sensor *sensor)
{ {
struct v4l2_ctrl *vblank = sensor->vblank; struct v4l2_ctrl *vblank = sensor->vblank;
struct v4l2_ctrl *hblank = sensor->hblank; struct v4l2_ctrl *hblank = sensor->hblank;
uint16_t min_fll, max_fll, min_llp, max_llp, min_lbp; u16 min_fll, max_fll, min_llp, max_llp, min_lbp;
int min, max; int min, max;
if (sensor->binning_vertical > 1 || sensor->binning_horizontal > 1) { if (sensor->binning_vertical > 1 || sensor->binning_horizontal > 1) {
......
...@@ -17,11 +17,10 @@ ...@@ -17,11 +17,10 @@
#include "ccs.h" #include "ccs.h"
#include "ccs-limits.h" #include "ccs-limits.h"
static uint32_t float_to_u32_mul_1000000(struct i2c_client *client, static u32 float_to_u32_mul_1000000(struct i2c_client *client, u32 phloat)
uint32_t phloat)
{ {
int32_t exp; s32 exp;
uint64_t man; u64 man;
if (phloat >= 0x80000000) { if (phloat >= 0x80000000) {
dev_err(&client->dev, "this is a negative number\n"); dev_err(&client->dev, "this is a negative number\n");
...@@ -137,11 +136,11 @@ static int ____ccs_read_addr_8only(struct ccs_sensor *sensor, u16 reg, ...@@ -137,11 +136,11 @@ static int ____ccs_read_addr_8only(struct ccs_sensor *sensor, u16 reg,
unsigned int ccs_reg_width(u32 reg) unsigned int ccs_reg_width(u32 reg)
{ {
if (reg & CCS_FL_16BIT) if (reg & CCS_FL_16BIT)
return sizeof(uint16_t); return sizeof(u16);
if (reg & CCS_FL_32BIT) if (reg & CCS_FL_32BIT)
return sizeof(uint32_t); return sizeof(u32);
return sizeof(uint8_t); return sizeof(u8);
} }
static u32 ireal32_to_u32_mul_1000000(struct i2c_client *client, u32 val) static u32 ireal32_to_u32_mul_1000000(struct i2c_client *client, u32 val)
...@@ -205,7 +204,7 @@ static int __ccs_read_data(struct ccs_reg *regs, size_t num_regs, ...@@ -205,7 +204,7 @@ static int __ccs_read_data(struct ccs_reg *regs, size_t num_regs,
size_t i; size_t i;
for (i = 0; i < num_regs; i++, regs++) { for (i = 0; i < num_regs; i++, regs++) {
uint8_t *data; u8 *data;
if (regs->addr + regs->len < CCS_REG_ADDR(reg) + width) if (regs->addr + regs->len < CCS_REG_ADDR(reg) + width)
continue; continue;
...@@ -216,13 +215,13 @@ static int __ccs_read_data(struct ccs_reg *regs, size_t num_regs, ...@@ -216,13 +215,13 @@ static int __ccs_read_data(struct ccs_reg *regs, size_t num_regs,
data = &regs->value[CCS_REG_ADDR(reg) - regs->addr]; data = &regs->value[CCS_REG_ADDR(reg) - regs->addr];
switch (width) { switch (width) {
case sizeof(uint8_t): case sizeof(u8):
*val = *data; *val = *data;
break; break;
case sizeof(uint16_t): case sizeof(u16):
*val = get_unaligned_be16(data); *val = get_unaligned_be16(data);
break; break;
case sizeof(uint32_t): case sizeof(u32):
*val = get_unaligned_be32(data); *val = get_unaligned_be32(data);
break; break;
default: default:
......
...@@ -84,11 +84,11 @@ struct ccs_hwconfig { ...@@ -84,11 +84,11 @@ struct ccs_hwconfig {
unsigned short i2c_addr_dfl; /* Default i2c addr */ unsigned short i2c_addr_dfl; /* Default i2c addr */
unsigned short i2c_addr_alt; /* Alternate i2c addr */ unsigned short i2c_addr_alt; /* Alternate i2c addr */
uint32_t ext_clk; /* sensor external clk */ u32 ext_clk; /* sensor external clk */
unsigned int lanes; /* Number of CSI-2 lanes */ unsigned int lanes; /* Number of CSI-2 lanes */
uint32_t csi_signalling_mode; /* CCS_CSI_SIGNALLING_MODE_* */ u32 csi_signalling_mode; /* CCS_CSI_SIGNALLING_MODE_* */
uint64_t *op_sys_clock; u64 *op_sys_clock;
enum ccs_module_board_orient module_board_orient; enum ccs_module_board_orient module_board_orient;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment