aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorEliot Blennerhassett <eblennerhassett@audioscience.com>2011-12-21 19:38:31 -0500
committerTakashi Iwai <tiwai@suse.de>2011-12-22 02:12:56 -0500
commitf6baaec2af36494469aa37558db8c79186f2fa03 (patch)
tree857f942084e825f6543cdd3abadabdb5a5146825 /sound
parent47a74a5d1ed2af23c2dc1ccfdcc0176e40404345 (diff)
ALSA: asihpi - Split hpi version info into separate header file.
and update HPI version to 4.10 Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/asihpi/hpi.h18
-rw-r--r--sound/pci/asihpi/hpi_version.h32
-rw-r--r--sound/pci/asihpi/hpidspcd.c23
-rw-r--r--sound/pci/asihpi/hpidspcd.h4
-rw-r--r--sound/pci/asihpi/hpimsgx.c3
-rw-r--r--sound/pci/asihpi/hpioctl.c1
6 files changed, 47 insertions, 34 deletions
diff --git a/sound/pci/asihpi/hpi.h b/sound/pci/asihpi/hpi.h
index f20727288994..771493798764 100644
--- a/sound/pci/asihpi/hpi.h
+++ b/sound/pci/asihpi/hpi.h
@@ -30,26 +30,8 @@
30 30
31#ifndef _HPI_H_ 31#ifndef _HPI_H_
32#define _HPI_H_ 32#define _HPI_H_
33/* HPI Version
34If HPI_VER_MINOR is odd then its a development release not intended for the
35public. If HPI_VER_MINOR is even then is a release version
36i.e 3.05.02 is a development version
37*/
38#define HPI_VERSION_CONSTRUCTOR(maj, min, rel) \
39 ((maj << 16) + (min << 8) + rel)
40
41#define HPI_VER_MAJOR(v) ((int)(v >> 16))
42#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
43#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))
44
45#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 8, 0)
46#define HPI_VER_STRING "4.08.00"
47
48/* Library version as documented in hpi-api-versions.txt */
49#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 0, 0)
50 33
51#include <linux/types.h> 34#include <linux/types.h>
52#define HPI_BUILD_EXCLUDE_DEPRECATED
53#define HPI_BUILD_KERNEL_MODE 35#define HPI_BUILD_KERNEL_MODE
54 36
55/******************************************************************************/ 37/******************************************************************************/
diff --git a/sound/pci/asihpi/hpi_version.h b/sound/pci/asihpi/hpi_version.h
new file mode 100644
index 000000000000..e9146e53bd50
--- /dev/null
+++ b/sound/pci/asihpi/hpi_version.h
@@ -0,0 +1,32 @@
1/** HPI Version Definitions
2Development releases have odd minor version.
3Production releases have even minor version.
4
5\file hpi_version.h
6*/
7
8#ifndef _HPI_VERSION_H
9#define _HPI_VERSION_H
10
11/* Use single digits for versions less that 10 to avoid octal. */
12/* *** HPI_VER is the only edit required to update version *** */
13/** HPI version */
14#define HPI_VER HPI_VERSION_CONSTRUCTOR(4, 10, 1)
15
16/** HPI version string in dotted decimal format */
17#define HPI_VER_STRING "4.10.01"
18
19/** Library version as documented in hpi-api-versions.txt */
20#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 2, 0)
21
22/** Construct hpi version number from major, minor, release numbers */
23#define HPI_VERSION_CONSTRUCTOR(maj, min, r) ((maj << 16) + (min << 8) + r)
24
25/** Extract major version from hpi version number */
26#define HPI_VER_MAJOR(v) ((int)(v >> 16))
27/** Extract minor version from hpi version number */
28#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
29/** Extract release from hpi version number */
30#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))
31
32#endif
diff --git a/sound/pci/asihpi/hpidspcd.c b/sound/pci/asihpi/hpidspcd.c
index 71d32c868c92..21cdb9e39fba 100644
--- a/sound/pci/asihpi/hpidspcd.c
+++ b/sound/pci/asihpi/hpidspcd.c
@@ -25,6 +25,7 @@ hotplug firmware loader from individual dsp code files
25#define SOURCEFILE_NAME "hpidspcd.c" 25#define SOURCEFILE_NAME "hpidspcd.c"
26#include "hpidspcd.h" 26#include "hpidspcd.h"
27#include "hpidebug.h" 27#include "hpidebug.h"
28#include "hpi_version.h"
28 29
29struct dsp_code_private { 30struct dsp_code_private {
30 /** Firmware descriptor */ 31 /** Firmware descriptor */
@@ -32,9 +33,6 @@ struct dsp_code_private {
32 struct pci_dev *dev; 33 struct pci_dev *dev;
33}; 34};
34 35
35#define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \
36 HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))
37
38/*-------------------------------------------------------------------*/ 36/*-------------------------------------------------------------------*/
39short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, 37short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
40 u32 *os_error_code) 38 u32 *os_error_code)
@@ -66,22 +64,25 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
66 if ((header.type != 0x45444F43) || /* "CODE" */ 64 if ((header.type != 0x45444F43) || /* "CODE" */
67 (header.adapter != adapter) 65 (header.adapter != adapter)
68 || (header.size != firmware->size)) { 66 || (header.size != firmware->size)) {
69 dev_printk(KERN_ERR, &dev->dev, "Invalid firmware file\n"); 67 dev_printk(KERN_ERR, &dev->dev,
68 "Invalid firmware header size %d != file %zd\n",
69 header.size, firmware->size);
70 goto error2; 70 goto error2;
71 } 71 }
72 72
73 if ((header.version / 100 & ~1) != (HPI_VER_DECIMAL / 100 & ~1)) { 73 if ((header.version >> 9) != (HPI_VER >> 9)) {
74 /* Consider even and subsequent odd minor versions to be compatible */
74 dev_printk(KERN_ERR, &dev->dev, 75 dev_printk(KERN_ERR, &dev->dev,
75 "Incompatible firmware version " 76 "Incompatible firmware version "
76 "DSP image %d != Driver %d\n", header.version, 77 "DSP image %X != Driver %X\n", header.version,
77 HPI_VER_DECIMAL); 78 HPI_VER);
78 goto error2; 79 goto error2;
79 } 80 }
80 81
81 if (header.version != HPI_VER_DECIMAL) { 82 if (header.version != HPI_VER) {
82 dev_printk(KERN_WARNING, &dev->dev, 83 dev_printk(KERN_INFO, &dev->dev,
83 "Firmware: release version mismatch DSP image %d != Driver %d\n", 84 "Firmware: release version mismatch DSP image %X != Driver %X\n",
84 header.version, HPI_VER_DECIMAL); 85 header.version, HPI_VER);
85 } 86 }
86 87
87 HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name); 88 HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name);
diff --git a/sound/pci/asihpi/hpidspcd.h b/sound/pci/asihpi/hpidspcd.h
index b22881122f19..659d19ca6d42 100644
--- a/sound/pci/asihpi/hpidspcd.h
+++ b/sound/pci/asihpi/hpidspcd.h
@@ -27,10 +27,6 @@ Functions for reading DSP code to load into DSP
27 27
28#include "hpi_internal.h" 28#include "hpi_internal.h"
29 29
30/** Code header version is decimal encoded e.g. 4.06.10 is 40601 */
31#define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \
32HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))
33
34/** Header structure for dsp firmware file 30/** Header structure for dsp firmware file
35 This structure must match that used in s2bin.c for generation of asidsp.bin 31 This structure must match that used in s2bin.c for generation of asidsp.bin
36 */ 32 */
diff --git a/sound/pci/asihpi/hpimsgx.c b/sound/pci/asihpi/hpimsgx.c
index 2e779421a618..d4790ddc225c 100644
--- a/sound/pci/asihpi/hpimsgx.c
+++ b/sound/pci/asihpi/hpimsgx.c
@@ -1,7 +1,7 @@
1/****************************************************************************** 1/******************************************************************************
2 2
3 AudioScience HPI driver 3 AudioScience HPI driver
4 Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> 4 Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of version 2 of the GNU General Public License as 7 it under the terms of version 2 of the GNU General Public License as
@@ -22,6 +22,7 @@ Extended Message Function With Response Caching
22*****************************************************************************/ 22*****************************************************************************/
23#define SOURCEFILE_NAME "hpimsgx.c" 23#define SOURCEFILE_NAME "hpimsgx.c"
24#include "hpi_internal.h" 24#include "hpi_internal.h"
25#include "hpi_version.h"
25#include "hpimsginit.h" 26#include "hpimsginit.h"
26#include "hpicmn.h" 27#include "hpicmn.h"
27#include "hpimsgx.h" 28#include "hpimsgx.h"
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c
index f6b9517b4696..75f7a2d11a3e 100644
--- a/sound/pci/asihpi/hpioctl.c
+++ b/sound/pci/asihpi/hpioctl.c
@@ -21,6 +21,7 @@ Common Linux HPI ioctl and module probe/remove functions
21#define SOURCEFILE_NAME "hpioctl.c" 21#define SOURCEFILE_NAME "hpioctl.c"
22 22
23#include "hpi_internal.h" 23#include "hpi_internal.h"
24#include "hpi_version.h"
24#include "hpimsginit.h" 25#include "hpimsginit.h"
25#include "hpidebug.h" 26#include "hpidebug.h"
26#include "hpimsgx.h" 27#include "hpimsgx.h"