From patchwork Mon Jul 16 09:08:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 10526291 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 E991E6020A for ; Mon, 16 Jul 2018 09:08:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D36B1288C3 for ; Mon, 16 Jul 2018 09:08:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C779428977; Mon, 16 Jul 2018 09:08:18 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,T_TVD_MIME_EPI 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 7A26F288C3 for ; Mon, 16 Jul 2018 09:08:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727192AbeGPJen (ORCPT ); Mon, 16 Jul 2018 05:34:43 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:35058 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727182AbeGPJen (ORCPT ); Mon, 16 Jul 2018 05:34:43 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 030FF8051F; Mon, 16 Jul 2018 11:08:14 +0200 (CEST) Date: Mon, 16 Jul 2018 11:08:14 +0200 From: Pavel Machek To: kernel list , linux-arm-kernel , linux-omap@vger.kernel.org, tony@atomide.com, sre@kernel.org, nekit1000@gmail.com, mpartap@gmx.net, merlijn@wizzup.org, gshark.jeong@gmail.com, m.chehab@samsung.com, sakari.ailus@iki.fi, linux-media@vger.kernel.org Subject: [PATCH v2] media: i2c: lm3560: use conservative defaults Message-ID: <20180716090814.GA4505@amd> References: <20180506080250.GA24114@amd> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180506080250.GA24114@amd> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If no pdata is found, we should use lowest current settings, not highest. Signed-off-by: Pavel Machek --- v2: I got notification from patchwork that patch no longer applies, so I'm rediffing the patch. diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c index b600e03a..c4e5ed5 100644 --- a/drivers/media/i2c/lm3560.c +++ b/drivers/media/i2c/lm3560.c @@ -420,14 +434,14 @@ static int lm3560_probe(struct i2c_client *client, pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); if (pdata == NULL) return -ENODEV; - pdata->peak = LM3560_PEAK_3600mA; - pdata->max_flash_timeout = LM3560_FLASH_TOUT_MAX; + pdata->peak = LM3560_PEAK_1600mA; + pdata->max_flash_timeout = LM3560_FLASH_TOUT_MIN; /* led 1 */ - pdata->max_flash_brt[LM3560_LED0] = LM3560_FLASH_BRT_MAX; - pdata->max_torch_brt[LM3560_LED0] = LM3560_TORCH_BRT_MAX; + pdata->max_flash_brt[LM3560_LED0] = LM3560_FLASH_BRT_MIN; + pdata->max_torch_brt[LM3560_LED0] = LM3560_TORCH_BRT_MIN; /* led 2 */ - pdata->max_flash_brt[LM3560_LED1] = LM3560_FLASH_BRT_MAX; - pdata->max_torch_brt[LM3560_LED1] = LM3560_TORCH_BRT_MAX; + pdata->max_flash_brt[LM3560_LED1] = LM3560_FLASH_BRT_MIN; + pdata->max_torch_brt[LM3560_LED1] = LM3560_TORCH_BRT_MIN; } flash->pdata = pdata; flash->dev = &client->dev;