From patchwork Mon Oct 19 21:55:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: German Galkin X-Patchwork-Id: 54846 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9JLu7qe008280 for ; Mon, 19 Oct 2009 21:56:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932329AbZJSVzt (ORCPT ); Mon, 19 Oct 2009 17:55:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932327AbZJSVzt (ORCPT ); Mon, 19 Oct 2009 17:55:49 -0400 Received: from fg-out-1718.google.com ([72.14.220.156]:61729 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932321AbZJSVzs (ORCPT ); Mon, 19 Oct 2009 17:55:48 -0400 Received: by fg-out-1718.google.com with SMTP id d23so1704001fga.1 for ; Mon, 19 Oct 2009 14:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=6oW1X37dKnrBUnhj84ipwawazh3Q8O3xBeNRgteTJLE=; b=LksuU2ydxhSCG+CSDwsv6Yi0GqwrNohvUd+XFFwN6tUJYo2JFe+tYkk55GnAt4+Gxa i41x05WkDyhc7fdAPbYPPYTz5FYrtfKb7HiLZKf3zyMTkkYa6DaCTdJJYqhtY+OqUEnD nySRJXPeNjdNIXc6PN/sZc1r13ylqfE8sQ0Q4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=EuQlE1QJ+qTjDx59mH0hQR5KzpVR55l5+Yc9k/DFn6tZNTo8ch3dKW2psRDXOyV/Qn K2tZ8ie9xWepP6CjvZtrTO1A3V3DV5SozPgq6uoHcen7i71rv3nmGpEm60vb5+C6cf/g Unr+M7T4Y6SheANBfzDQZBo+wJzsFZJZDP+cU= Received: by 10.86.235.14 with SMTP id i14mr3351488fgh.52.1255989352248; Mon, 19 Oct 2009 14:55:52 -0700 (PDT) Received: from ?10.0.0.1? (198.39.broadband4.iol.cz [85.71.39.198]) by mx.google.com with ESMTPS id d8sm150696fga.23.2009.10.19.14.55.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Oct 2009 14:55:51 -0700 (PDT) Subject: [PATCH] sn9c20x: fixed exposure control for HV7131R sensor From: German Galkin To: Mauro Carvalho Chehab , linux-media@vger.kernel.org Date: Mon, 19 Oct 2009 23:55:49 +0200 Message-Id: <1255989349.4536.22.camel@pexis.zodiac.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index 99632a7..f173b35 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c @@ -1656,9 +1656,9 @@ static int set_exposure(struct gspca_dev *gspca_dev) case SENSOR_HV7131R: exp[0] |= (4 << 4); exp[2] = 0x25; - exp[3] = ((sd->exposure * 0xffffff) / 0xffff) >> 16; - exp[4] = ((sd->exposure * 0xffffff) / 0xffff) >> 8; - exp[5] = ((sd->exposure * 0xffffff) / 0xffff) & 0xff; + exp[3] = (sd->exposure >> 5) & 0xff; + exp[4] = (sd->exposure << 3) & 0xff; + exp[5] = 0; break; default: