From patchwork Tue Dec 27 09:26:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 9489105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9EEA560838 for ; Tue, 27 Dec 2016 09:26:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 900662094D for ; Tue, 27 Dec 2016 09:26:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 847D420951; Tue, 27 Dec 2016 09:26:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 684E52094D for ; Tue, 27 Dec 2016 09:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753360AbcL0J0p (ORCPT ); Tue, 27 Dec 2016 04:26:45 -0500 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:43738 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753319AbcL0J0o (ORCPT ); Tue, 27 Dec 2016 04:26:44 -0500 Received: from valkosipuli.retiisi.org.uk (valkosipuli.retiisi.org.uk [IPv6:2001:1bc8:1a6:d3d5::80:2]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id 7E15460098; Tue, 27 Dec 2016 11:26:36 +0200 (EET) Received: by valkosipuli.retiisi.org.uk (Postfix, from userid 1000) id 3588320412; Tue, 27 Dec 2016 11:26:36 +0200 (EET) Date: Tue, 27 Dec 2016 11:26:35 +0200 From: Sakari Ailus To: Pavel Machek Cc: ivo.g.dimitrov.75@gmail.com, sre@kernel.org, pali.rohar@gmail.com, linux-media@vger.kernel.org, galak@codeaurora.org, mchehab@osg.samsung.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6] media: Driver for Toshiba et8ek8 5MP sensor Message-ID: <20161227092634.GK16630@valkosipuli.retiisi.org.uk> References: <20161023200355.GA5391@amd> <20161119232943.GF13965@valkosipuli.retiisi.org.uk> <20161214122451.GB27011@amd> <20161222100104.GA30917@amd> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161222100104.GA30917@amd> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Dec 22, 2016 at 11:01:04AM +0100, Pavel Machek wrote: > > Add driver for et8ek8 sensor, found in Nokia N900 main camera. Can be > used for taking photos in 2.5MP resolution with fcam-dev. > > Signed-off-by: Ivaylo Dimitrov > Signed-off-by: Pavel Machek Thanks! I fixed a few checkpatch warnings and one or two minor matters, the diff is here. No functional changes. I'm a bit surprised checkpatch.pl suggests to use numerical values for permissions but I think I agree with that. Reason is prioritised agains the rules. :-) Btw. should we update maintainers as well? Would you like to put yourself there? Feel free to add me, too... The patches are here. I think they should be good to go to v4.11. Let me know if you're (not) happy with these: diff --git a/drivers/media/i2c/et8ek8/et8ek8_driver.c b/drivers/media/i2c/et8ek8/et8ek8_driver.c index d3de087..2df3ff4 100644 --- a/drivers/media/i2c/et8ek8/et8ek8_driver.c +++ b/drivers/media/i2c/et8ek8/et8ek8_driver.c @@ -347,13 +347,13 @@ static int et8ek8_i2c_write_reg(struct i2c_client *client, u16 data_length, et8ek8_i2c_create_msg(client, data_length, reg, val, &msg, data); r = i2c_transfer(client->adapter, &msg, 1); - if (r < 0) + if (r < 0) { dev_err(&client->dev, "wrote 0x%x to offset 0x%x error %d\n", val, reg, r); - else - r = 0; /* on success i2c_transfer() returns messages trasfered */ + return r; + } - return r; + return 0; } static struct et8ek8_reglist *et8ek8_reglist_find_type( @@ -620,14 +620,13 @@ static int et8ek8_set_test_pattern(struct et8ek8_sensor *sensor, s32 mode) rval = et8ek8_i2c_write_reg(client, ET8EK8_REG_8BIT, 0x1124, cbv_mode << 7); if (rval) - return rval; + return rval; rval = et8ek8_i2c_write_reg(client, ET8EK8_REG_8BIT, 0x112C, din_sw); if (rval) return rval; - rval = et8ek8_i2c_write_reg(client, ET8EK8_REG_8BIT, 0x1420, r1420); - return rval; + return et8ek8_i2c_write_reg(client, ET8EK8_REG_8BIT, 0x1420, r1420); } /* ----------------------------------------------------------------------------- @@ -645,11 +644,11 @@ static int et8ek8_set_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_EXPOSURE: { - int rows; - struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); - rows = ctrl->val; + struct i2c_client *client = + v4l2_get_subdevdata(&sensor->subdev); + return et8ek8_i2c_write_reg(client, ET8EK8_REG_16BIT, 0x1243, - rows); + ctrl->val); } case V4L2_CID_TEST_PATTERN: @@ -695,8 +694,9 @@ static int et8ek8_init_controls(struct et8ek8_sensor *sensor) u32 min = 1, max = max_rows; sensor->exposure = - v4l2_ctrl_new_std(&sensor->ctrl_handler, &et8ek8_ctrl_ops, - V4L2_CID_EXPOSURE, min, max, min, max); + v4l2_ctrl_new_std(&sensor->ctrl_handler, + &et8ek8_ctrl_ops, V4L2_CID_EXPOSURE, + min, max, min, max); } /* V4L2_CID_PIXEL_RATE */ @@ -722,7 +722,7 @@ static void et8ek8_update_controls(struct et8ek8_sensor *sensor) { struct v4l2_ctrl *ctrl; struct et8ek8_mode *mode = &sensor->current_reglist->mode; - + u32 min, max, pixel_rate; static const int S = 8; @@ -1248,7 +1248,7 @@ et8ek8_priv_mem_read(struct device *dev, struct device_attribute *attr, return ET8EK8_PRIV_MEM_SIZE; } -static DEVICE_ATTR(priv_mem, S_IRUGO, et8ek8_priv_mem_read, NULL); +static DEVICE_ATTR(priv_mem, 0444, et8ek8_priv_mem_read, NULL); /* -------------------------------------------------------------------------- * V4L2 subdev core operations