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>
This commit is contained in:
Eliot Blennerhassett 2011-12-22 13:38:31 +13:00 committed by Takashi Iwai
parent 47a74a5d1e
commit f6baaec2af
6 changed files with 47 additions and 34 deletions

View File

@ -30,26 +30,8 @@
#ifndef _HPI_H_
#define _HPI_H_
/* HPI Version
If HPI_VER_MINOR is odd then its a development release not intended for the
public. If HPI_VER_MINOR is even then is a release version
i.e 3.05.02 is a development version
*/
#define HPI_VERSION_CONSTRUCTOR(maj, min, rel) \
((maj << 16) + (min << 8) + rel)
#define HPI_VER_MAJOR(v) ((int)(v >> 16))
#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))
#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 8, 0)
#define HPI_VER_STRING "4.08.00"
/* Library version as documented in hpi-api-versions.txt */
#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 0, 0)
#include <linux/types.h>
#define HPI_BUILD_EXCLUDE_DEPRECATED
#define HPI_BUILD_KERNEL_MODE
/******************************************************************************/

View File

@ -0,0 +1,32 @@
/** HPI Version Definitions
Development releases have odd minor version.
Production releases have even minor version.
\file hpi_version.h
*/
#ifndef _HPI_VERSION_H
#define _HPI_VERSION_H
/* Use single digits for versions less that 10 to avoid octal. */
/* *** HPI_VER is the only edit required to update version *** */
/** HPI version */
#define HPI_VER HPI_VERSION_CONSTRUCTOR(4, 10, 1)
/** HPI version string in dotted decimal format */
#define HPI_VER_STRING "4.10.01"
/** Library version as documented in hpi-api-versions.txt */
#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 2, 0)
/** Construct hpi version number from major, minor, release numbers */
#define HPI_VERSION_CONSTRUCTOR(maj, min, r) ((maj << 16) + (min << 8) + r)
/** Extract major version from hpi version number */
#define HPI_VER_MAJOR(v) ((int)(v >> 16))
/** Extract minor version from hpi version number */
#define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF))
/** Extract release from hpi version number */
#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))
#endif

View File

@ -25,6 +25,7 @@ hotplug firmware loader from individual dsp code files
#define SOURCEFILE_NAME "hpidspcd.c"
#include "hpidspcd.h"
#include "hpidebug.h"
#include "hpi_version.h"
struct dsp_code_private {
/** Firmware descriptor */
@ -32,9 +33,6 @@ struct dsp_code_private {
struct pci_dev *dev;
};
#define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \
HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))
/*-------------------------------------------------------------------*/
short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
u32 *os_error_code)
@ -66,22 +64,25 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
if ((header.type != 0x45444F43) || /* "CODE" */
(header.adapter != adapter)
|| (header.size != firmware->size)) {
dev_printk(KERN_ERR, &dev->dev, "Invalid firmware file\n");
dev_printk(KERN_ERR, &dev->dev,
"Invalid firmware header size %d != file %zd\n",
header.size, firmware->size);
goto error2;
}
if ((header.version / 100 & ~1) != (HPI_VER_DECIMAL / 100 & ~1)) {
if ((header.version >> 9) != (HPI_VER >> 9)) {
/* Consider even and subsequent odd minor versions to be compatible */
dev_printk(KERN_ERR, &dev->dev,
"Incompatible firmware version "
"DSP image %d != Driver %d\n", header.version,
HPI_VER_DECIMAL);
"DSP image %X != Driver %X\n", header.version,
HPI_VER);
goto error2;
}
if (header.version != HPI_VER_DECIMAL) {
dev_printk(KERN_WARNING, &dev->dev,
"Firmware: release version mismatch DSP image %d != Driver %d\n",
header.version, HPI_VER_DECIMAL);
if (header.version != HPI_VER) {
dev_printk(KERN_INFO, &dev->dev,
"Firmware: release version mismatch DSP image %X != Driver %X\n",
header.version, HPI_VER);
}
HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name);

View File

@ -27,10 +27,6 @@ Functions for reading DSP code to load into DSP
#include "hpi_internal.h"
/** Code header version is decimal encoded e.g. 4.06.10 is 40601 */
#define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \
HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER)))
/** Header structure for dsp firmware file
This structure must match that used in s2bin.c for generation of asidsp.bin
*/

View File

@ -1,7 +1,7 @@
/******************************************************************************
AudioScience HPI driver
Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>
Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com>
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
@ -22,6 +22,7 @@ Extended Message Function With Response Caching
*****************************************************************************/
#define SOURCEFILE_NAME "hpimsgx.c"
#include "hpi_internal.h"
#include "hpi_version.h"
#include "hpimsginit.h"
#include "hpicmn.h"
#include "hpimsgx.h"

View File

@ -21,6 +21,7 @@ Common Linux HPI ioctl and module probe/remove functions
#define SOURCEFILE_NAME "hpioctl.c"
#include "hpi_internal.h"
#include "hpi_version.h"
#include "hpimsginit.h"
#include "hpidebug.h"
#include "hpimsgx.h"