[PATCH] Subject: drivers:staging:media:atomisp:12c:ab1302.c fix CHECK
CHECK: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL. remove the unnecessary paragraph Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index bacffbe..9d6ce36 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -11,11 +11,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - * */ #include "../include/linux/atomisp.h" -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Subject: drivers:staging:media:atomisp:12c:ab1302.c fix CHECK
CHECK: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL. remove the unnecessary paragraph Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index bacffbe..9d6ce36 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -11,11 +11,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - * */ #include "../include/linux/atomisp.h" -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Subject:drivers:staging:media:atomisp:i2c:api1302.c
Fix Warning Block comments use * on subsequent lines Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index 9d6ce36..ac1aa96 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -158,8 +158,9 @@ static struct ap1302_context_info context_info[] = { }; /* This array stores the description list for metadata. - The metadata contains exposure settings and face - detection results. */ + * The metadata contains exposure settings and face + * detection results. + */ static u16 ap1302_ss_list[] = { 0xb01c, /* From 0x0186 with size 0x1C are exposure settings. */ 0x0186, -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Subject:drivers:staging:media:atomisp:
Fix Warning from checkpatch.pl Block comments use * on subsequent lines Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index 9d6ce36..ac1aa96 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -158,8 +158,9 @@ static struct ap1302_context_info context_info[] = { }; /* This array stores the description list for metadata. - The metadata contains exposure settings and face - detection results. */ + * The metadata contains exposure settings and face + * detection results. + */ static u16 ap1302_ss_list[] = { 0xb01c, /* From 0x0186 with size 0x1C are exposure settings. */ 0x0186, -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Subject:staging:media:atomisp:ap1302: fix comments style
fix comment style Warning in ap1302.c fix WARNING on Block comments use * on subsequent lines Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index ac1aa96..995f243 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -157,9 +157,11 @@ static struct ap1302_context_info context_info[] = { {CNTX_HINF_CTRL, AP1302_REG16, "hinf_ctrl"}, }; -/* This array stores the description list for metadata. +/* + * This array stores the description list for metadata. * The metadata contains exposure settings and face * detection results. + * */ static u16 ap1302_ss_list[] = { 0xb01c, /* From 0x0186 with size 0x1C are exposure settings. */ -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:media:atomisp: Add blank line after declarations
Add blank line after declarations to avoid warning from checkpatch.pl script Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index 995f243..fd0f2ac 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -211,6 +211,7 @@ static int ap1302_i2c_write_reg(struct v4l2_subdev *sd, struct ap1302_device *dev = to_ap1302_device(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); int ret; + if (len == AP1302_REG16) ret = regmap_write(dev->regmap16, reg, val); else if (len == AP1302_REG32) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] media:staging:atomisp:ap1302: Fix comment style
fix comment style to avoid warning from checkpatch.pl script Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index fd0f2ac..7a0c0d5 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -235,11 +235,14 @@ static u16 ap1302_calculate_context_reg_addr(enum ap1302_contexts context, u16 offset) { u16 reg_addr; - /* The register offset is defined according to preview/video registers. - Preview and video context have the same register definition. - But snapshot context does not have register S1_SENSOR_MODE. - When setting snapshot registers, if the offset exceeds - S1_SENSOR_MODE, the actual offset needs to minus 2. */ + /* +* The register offset is defined according to preview/video registers. +* Preview and video context have the same register definition. +* But snapshot context does not have register S1_SENSOR_MODE. +* When setting snapshot registers, if the offset exceeds +* S1_SENSOR_MODE, the actual offset needs to minus 2. +* +*/ if (context == CONTEXT_SNAPSHOT) { if (offset == CNTX_S1_SENSOR_MODE) return 0; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] media:atomisp:ap1302 Fix style warning
Add a blank line after declarations to avoid checkpatch.pl script warning Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index 7a0c0d5..fba4f96 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -263,6 +263,7 @@ static int ap1302_read_context_reg(struct v4l2_subdev *sd, { struct ap1302_device *dev = to_ap1302_device(sd); u16 reg_addr = ap1302_calculate_context_reg_addr(context, offset); + if (reg_addr == 0) return -EINVAL; return ap1302_i2c_read_reg(sd, reg_addr, len, -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media: atomisp: Add blank line after variable declarations.
This patch fixes the checkpatch.pl warning WARNING: Missing a blank line after declarations + int i; + dev_dbg(&client->dev, "Dump registers for context[%d]:\n", context) WARNING: Missing a blank line after declarations + int ret; + ret = request_firmware(&dev->fw, "ap1302_fw.bin", &client->dev); WARNING: Missing a blank line after declarations + u32 sub_len; + for (pos = 0; pos < len; pos += sub_len) { WARNING: Missing a blank line after declarations + struct ap1302_device *dev = to_ap1302_device(sd); + return dev->cur_context; WARNING: Missing a blank line after declarations + enum ap1302_contexts context, main_context; + if (format->pad) WARNING: Missing a blank line after declarations + long ret = 0; + switch (cmd) { Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index fba4f96..3e229ba 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -275,6 +275,7 @@ static int ap1302_write_context_reg(struct v4l2_subdev *sd, { struct ap1302_device *dev = to_ap1302_device(sd); u16 reg_addr = ap1302_calculate_context_reg_addr(context, offset); + if (reg_addr == 0) return -EINVAL; return ap1302_i2c_write_reg(sd, reg_addr, len, @@ -287,6 +288,7 @@ static int ap1302_dump_context_reg(struct v4l2_subdev *sd, struct i2c_client *client = v4l2_get_subdevdata(sd); struct ap1302_device *dev = to_ap1302_device(sd); int i; + dev_dbg(&client->dev, "Dump registers for context[%d]:\n", context); for (i = 0; i < ARRAY_SIZE(context_info); i++) { struct ap1302_context_info *info = &context_info[i]; @@ -311,6 +313,7 @@ static int ap1302_request_firmware(struct v4l2_subdev *sd) struct i2c_client *client = v4l2_get_subdevdata(sd); struct ap1302_device *dev = to_ap1302_device(sd); int ret; + ret = request_firmware(&dev->fw, "ap1302_fw.bin", &client->dev); if (ret) dev_err(&client->dev, @@ -539,6 +542,7 @@ static int ap1302_s_config(struct v4l2_subdev *sd, void *pdata) static enum ap1302_contexts ap1302_get_context(struct v4l2_subdev *sd) { struct ap1302_device *dev = to_ap1302_device(sd); + return dev->cur_context; } @@ -641,6 +645,7 @@ static int ap1302_set_fmt(struct v4l2_subdev *sd, struct atomisp_input_stream_info *stream_info = (struct atomisp_input_stream_info *)fmt->reserved; enum ap1302_contexts context, main_context; + if (format->pad) return -EINVAL; if (!fmt) @@ -1003,6 +1008,7 @@ static int ap1302_s_register(struct v4l2_subdev *sd, static long ap1302_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { long ret = 0; + switch (cmd) { case VIDIOC_DBG_G_REGISTER: ret = ap1302_g_register(sd, arg); -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:media:atomisp:Fix block comments use * on subsequent lines ap1302.c
This patch fixes the warning WARNING: Block comments use * on subsequent lines +/* When loading firmware, host writes firmware data from address 0x8000. + When the address reaches 0x9FFF, the next address should return to 0x8000. WARNING: Block comments use a trailing */ on a separate line + that has been written to.*/ WARNING: Block comments use * on subsequent lines + /* The fw binary contains a header of struct ap1302_firmware. + Following the header is the bootdata of AP1302. WARNING: Block comments use a trailing */ on a separate line + The bootdata pointer can be referenced as &fw[1]. */ WARNING: Block comments use * on subsequent lines + /* Write 2 to bootdata_stage register to apply basic_init_hp + settings and enable PLL. */ WARNING: Block comments use a trailing */ on a separate line + settings and enable PLL. */ WARNING: Block comments use * on subsequent lines + /* Write 0x to bootdata_stage register to indicate AP1302 that + the whole bootdata content has been loaded. */ WARNING: Block comments use a trailing */ on a separate line + the whole bootdata content has been loaded. */ Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 38 -- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index 3e229ba..68e0b83 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -321,12 +321,15 @@ static int ap1302_request_firmware(struct v4l2_subdev *sd) return ret; } -/* When loading firmware, host writes firmware data from address 0x8000. - When the address reaches 0x9FFF, the next address should return to 0x8000. - This function handles this address window and load firmware data to AP1302. - win_pos indicates the offset within this window. Firmware loading procedure - may call this function several times. win_pos records the current position - that has been written to.*/ +/* + * When loading firmware, host writes firmware data from address 0x8000. + * When the address reaches 0x9FFF, the next address should return to 0x8000. + * This function handles this address window and load firmware data to AP1302. + * win_pos indicates the offset within this window. Firmware loading procedure + * may call this function several times. win_pos records the current position + * that has been written to. + * + */ static int ap1302_write_fw_window(struct v4l2_subdev *sd, u16 *win_pos, const u8 *buf, u32 len) { @@ -371,9 +374,12 @@ static int ap1302_load_firmware(struct v4l2_subdev *sd) dev_err(&client->dev, "firmware size does not match.\n"); return -EINVAL; } - /* The fw binary contains a header of struct ap1302_firmware. - Following the header is the bootdata of AP1302. - The bootdata pointer can be referenced as &fw[1]. */ + /* +* The fw binary contains a header of struct ap1302_firmware. +* Following the header is the bootdata of AP1302. +* The bootdata pointer can be referenced as &fw[1]. +* +*/ fw_data = (u8 *)&fw[1]; /* Clear crc register. */ @@ -386,8 +392,11 @@ static int ap1302_load_firmware(struct v4l2_subdev *sd) if (ret) return ret; - /* Write 2 to bootdata_stage register to apply basic_init_hp - settings and enable PLL. */ + /* +* Write 2 to bootdata_stage register to apply basic_init_hp +* settings and enable PLL. +* +*/ ret = ap1302_i2c_write_reg(sd, REG_BOOTDATA_STAGE, AP1302_REG16, 0x0002); if (ret) @@ -413,8 +422,11 @@ static int ap1302_load_firmware(struct v4l2_subdev *sd) return -EAGAIN; } - /* Write 0x to bootdata_stage register to indicate AP1302 that - the whole bootdata content has been loaded. */ + /* +* Write 0x to bootdata_stage register to indicate AP1302 that +* the whole bootdata content has been loaded. +* +*/ ret = ap1302_i2c_write_reg(sd, REG_BOOTDATA_STAGE, AP1302_REG16, 0x); if (ret) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:media:atomisp:Fix trivial codingstyle issues
change comment style to match codingstyle. Issue found by checkpatch change four comments. Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 38 -- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index 3e229ba..68e0b83 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -321,12 +321,15 @@ static int ap1302_request_firmware(struct v4l2_subdev *sd) return ret; } -/* When loading firmware, host writes firmware data from address 0x8000. - When the address reaches 0x9FFF, the next address should return to 0x8000. - This function handles this address window and load firmware data to AP1302. - win_pos indicates the offset within this window. Firmware loading procedure - may call this function several times. win_pos records the current position - that has been written to.*/ +/* + * When loading firmware, host writes firmware data from address 0x8000. + * When the address reaches 0x9FFF, the next address should return to 0x8000. + * This function handles this address window and load firmware data to AP1302. + * win_pos indicates the offset within this window. Firmware loading procedure + * may call this function several times. win_pos records the current position + * that has been written to. + * + */ static int ap1302_write_fw_window(struct v4l2_subdev *sd, u16 *win_pos, const u8 *buf, u32 len) { @@ -371,9 +374,12 @@ static int ap1302_load_firmware(struct v4l2_subdev *sd) dev_err(&client->dev, "firmware size does not match.\n"); return -EINVAL; } - /* The fw binary contains a header of struct ap1302_firmware. - Following the header is the bootdata of AP1302. - The bootdata pointer can be referenced as &fw[1]. */ + /* +* The fw binary contains a header of struct ap1302_firmware. +* Following the header is the bootdata of AP1302. +* The bootdata pointer can be referenced as &fw[1]. +* +*/ fw_data = (u8 *)&fw[1]; /* Clear crc register. */ @@ -386,8 +392,11 @@ static int ap1302_load_firmware(struct v4l2_subdev *sd) if (ret) return ret; - /* Write 2 to bootdata_stage register to apply basic_init_hp - settings and enable PLL. */ + /* +* Write 2 to bootdata_stage register to apply basic_init_hp +* settings and enable PLL. +* +*/ ret = ap1302_i2c_write_reg(sd, REG_BOOTDATA_STAGE, AP1302_REG16, 0x0002); if (ret) @@ -413,8 +422,11 @@ static int ap1302_load_firmware(struct v4l2_subdev *sd) return -EAGAIN; } - /* Write 0x to bootdata_stage register to indicate AP1302 that - the whole bootdata content has been loaded. */ + /* +* Write 0x to bootdata_stage register to indicate AP1302 that +* the whole bootdata content has been loaded. +* +*/ ret = ap1302_i2c_write_reg(sd, REG_BOOTDATA_STAGE, AP1302_REG16, 0x); if (ret) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:media:atomisp:Fix code indent error
code indent should use tabs where possible change spaces to tabs Signed-off-by: Harold Gomez --- drivers/staging/media/atomisp/i2c/ap1302.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c b/drivers/staging/media/atomisp/i2c/ap1302.c index bacffbe..538a064 100644 --- a/drivers/staging/media/atomisp/i2c/ap1302.c +++ b/drivers/staging/media/atomisp/i2c/ap1302.c @@ -606,7 +606,7 @@ static s32 ap1302_try_mbus_fmt_locked(struct v4l2_subdev *sd, static int ap1302_get_fmt(struct v4l2_subdev *sd, -struct v4l2_subdev_pad_config *cfg, +struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *format) { -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel