From patchwork Tue Feb 3 01:08:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Klimov X-Patchwork-Id: 5165 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 n1318LcT031257 for ; Tue, 3 Feb 2009 01:08:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753029AbZBCBIu (ORCPT ); Mon, 2 Feb 2009 20:08:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753078AbZBCBIu (ORCPT ); Mon, 2 Feb 2009 20:08:50 -0500 Received: from fg-out-1718.google.com ([72.14.220.157]:44655 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753029AbZBCBIt (ORCPT ); Mon, 2 Feb 2009 20:08:49 -0500 Received: by fg-out-1718.google.com with SMTP id 16so763430fgg.17 for ; Mon, 02 Feb 2009 17:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=+r2cAtyiR5z5QpqsiaWaXDSC9HWLXFrrv57FnIYxC2U=; b=xlxY3Qrugg86t71INrFHzZJ5RXqwLsK8nS7LnmqFvtJKDqEtp+nRdlXAFmolu4kO/D pPlCYGoECsJpoaNhbd5gfoVJeiTxH0H/nbFmbq7LrUBDwv7diCUq5Pu2Bzhx+8WZM3We pYzK7hU2Iwhu0bxRlwOONnE3lVM2QN+3FdtJc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=njCYlUsQq78e1OvlddpvVlZHwHF8vWaueMCfOS+0zZCmuGnRkBXPfnh7Hlqe8QQDnT 6ksTunlom54OEzpevIsdGyv4ChF32ipohkioaDIG/jY+X7subdXuoWi6hydlTjYOY5US 418aeGqs8f1tp069LK2WJR2l0bTUgPEWaC42E= Received: by 10.86.4.2 with SMTP id 2mr954373fgd.50.1233623328849; Mon, 02 Feb 2009 17:08:48 -0800 (PST) Received: from ?192.168.1.42? (gw.zunet.ru [217.67.117.64]) by mx.google.com with ESMTPS id l12sm1184057fgb.41.2009.02.02.17.08.48 (version=SSLv3 cipher=RC4-MD5); Mon, 02 Feb 2009 17:08:48 -0800 (PST) Subject: [patch review 5/8] radio-mr800: fix amradio_set_freq From: Alexey Klimov To: Douglas Schilling Landgraf Cc: linux-media@vger.kernel.org Date: Tue, 03 Feb 2009 04:08:45 +0300 Message-Id: <1233623325.17456.261.camel@tux.localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Fixing frequency adjustment to provide better diapason(band?) fit. Also, add AMRADIO_SET_FREQ to the list of commands. Signed-off-by: Alexey Klimov diff -r d2d1176133ad linux/drivers/media/radio/radio-mr800.c --- a/linux/drivers/media/radio/radio-mr800.c Mon Feb 02 03:57:46 2009 +0300 +++ b/linux/drivers/media/radio/radio-mr800.c Mon Feb 02 06:38:01 2009 +0300 @@ -92,6 +92,7 @@ * Commands that device should understand * List isnt full and will be updated with implementation of new functions */ +#define AMRADIO_SET_FREQ 0xa4 #define AMRADIO_SET_MUTE 0xab /* Comfortable defines for amradio_set_mute */ @@ -223,7 +224,7 @@ { int retval; int size; - unsigned short freq_send = 0x13 + (freq >> 3) / 25; + unsigned short freq_send = 0x10 + (freq >> 3) / 25; /* safety check */ if (radio->removed) @@ -235,7 +236,7 @@ radio->buffer[1] = 0x55; radio->buffer[2] = 0xaa; radio->buffer[3] = 0x03; - radio->buffer[4] = 0xa4; + radio->buffer[4] = AMRADIO_SET_FREQ; radio->buffer[5] = 0x00; radio->buffer[6] = 0x00; radio->buffer[7] = 0x08;