From patchwork Wed Oct 23 01:20:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 3085761 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7C4319F2B8 for ; Wed, 23 Oct 2013 01:21:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ADBE5201BF for ; Wed, 23 Oct 2013 01:21:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93EE520353 for ; Wed, 23 Oct 2013 01:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754468Ab3JWBVO (ORCPT ); Tue, 22 Oct 2013 21:21:14 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:40952 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755300Ab3JWBVM (ORCPT ); Tue, 22 Oct 2013 21:21:12 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MV300JIZL1BN090@mailout3.samsung.com>; Wed, 23 Oct 2013 10:20:59 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.48]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id FE.3A.07052.B7427625; Wed, 23 Oct 2013 10:20:59 +0900 (KST) X-AuditID: cbfee691-b7f866d000001b8c-4c-5267247b48a3 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 82.3D.09687.B7427625; Wed, 23 Oct 2013 10:20:59 +0900 (KST) Received: from DOJG1HAN03 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MV3000KFL2ZHB40@mmp1.samsung.com>; Wed, 23 Oct 2013 10:20:59 +0900 (KST) From: Jingoo Han To: 'Johan Hovold' Cc: 'Richard Purdie' , 'Nicolas Ferre' , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, 'Jingoo Han' References: <1382462819-28576-1-git-send-email-jhovold@gmail.com> <1382462819-28576-2-git-send-email-jhovold@gmail.com> In-reply-to: <1382462819-28576-2-git-send-email-jhovold@gmail.com> Subject: Re: [PATCH 1/9] backlight: atmel-pwm-bl: fix reported brightness Date: Wed, 23 Oct 2013 10:20:59 +0900 Message-id: <001901cecf8e$21764db0$6462e910$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac7PS/RjWC/OkS1dQmy5wBjBYeX3+QAQgPPg Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCIsWRmVeSWpSXmKPExsVy+t8zA91qlfQgg1vfVSxeHtK0uLzwEqvF 3lXSFif6PrBaXN41h83i2+Vmdovdu56yWizY+IjRgcNjwa+tLB47Z91l99gz/werR9+WVYwe nzfJBbBGcdmkpOZklqUW6dslcGUcuPaNvWCfQEXDtY2sDYxvebsYOTkkBEwkOjZ+ZoGwxSQu 3FvP1sXIxSEksIxRYvWjCWwwRZf/n2KGSCxilGhf8ZoFwvnFKPFhzQKwKjYBNYkvXw6zg9gi QPaT3iPsIEXMAhcYJY6/fMIIkhASqJS413uBCcTmFHCS+D79EVizsICnxLr+s2B3sAioSlz5 MQdoHQcHr4CtxKztLiBhXgFBiR+T74GVMAtoSazfeZwJwpaX2LzmLVi5hIC6xKO/uiCmiICR xK9v9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xJpYVV+YeYpTgYFYS4W32BQrx piRWVqUW5ccXleakFh9iTAZ6cyKzlGhyPjB55ZXEGxqbmBlZGplZGJmYm5MmrCTOe6DVOlBI ID2xJDU7NbUgtQhmCxMHp1QDo8zDI2aHCjk21l3/e7hsg5q+yd+D7530LqdkG9pOVGzPVe68 FZ8z28y+QGDihzsySerfmfIlfOsvf9hgdIbrgqS8bjbv/TN+8lEHvS/b+CwqufXM0emCTEuC rkTxI/F7U53Whiot+LrzwKzFrvOSE+qtc26XKrjr36yN/37WwlleIPp1HleWEktxRqKhFnNR cSIAsAji6FQDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wednesday, October 23, 2013 2:27 AM, Johan Hovold wrote: > > The driver supports 16-bit brightness values, but the value returned > from get_brightness was truncated to eight bits. > > Cc: stable@vger.kernel.org > Signed-off-by: Johan Hovold > --- > drivers/video/backlight/atmel-pwm-bl.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c > index 66885fb..8aac273 100644 > --- a/drivers/video/backlight/atmel-pwm-bl.c > +++ b/drivers/video/backlight/atmel-pwm-bl.c > @@ -70,7 +70,7 @@ static int atmel_pwm_bl_set_intensity(struct backlight_device *bd) > static int atmel_pwm_bl_get_intensity(struct backlight_device *bd) > { > struct atmel_pwm_bl *pwmbl = bl_get_data(bd); > - u8 intensity; > + u32 intensity; > > if (pwmbl->pdata->pwm_active_low) { > intensity = pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY) - > @@ -80,7 +80,7 @@ static int atmel_pwm_bl_get_intensity(struct backlight_device *bd) > pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY); > } > > - return intensity; > + return (u16)intensity; However, atmel_pwm_bl_get_intensity() should return 'int', instead of 'u16'. Also, pwm_channel_readl() returns 'u32'. Then, how about the following? Jingoo Han --- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/video/backlight/atmel-pwm-bl.c +++ b/drivers/video/backlight/atmel-pwm-bl.c @@ -70,17 +70,17 @@ static int atmel_pwm_bl_set_intensity(struct backlight_device *bd) static int atmel_pwm_bl_get_intensity(struct backlight_device *bd) { struct atmel_pwm_bl *pwmbl = bl_get_data(bd); - u8 intensity; + u16 intensity; if (pwmbl->pdata->pwm_active_low) { - intensity = pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY) - + intensity = (u16) pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY) - pwmbl->pdata->pwm_duty_min; } else { - intensity = pwmbl->pdata->pwm_duty_max - + intensity = (u16) pwmbl->pdata->pwm_duty_max - pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY); } - return intensity; + return (int)intensity; } Best regards,