Skip to content

Commit

Permalink
ALSA: asihpi - Add hd radio blend functions
Browse files Browse the repository at this point in the history
Add hd radio blend functions. HPI version inc to 4.03.25.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Eliot Blennerhassett authored and Takashi Iwai committed May 27, 2010
1 parent f038e27 commit 5a498ef
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
8 changes: 7 additions & 1 deletion sound/pci/asihpi/hpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ i.e 3.05.02 is a development version
#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))

/* Use single digits for versions less that 10 to avoid octal. */
#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 3, 18)
#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 3, 25)

/* Library version as documented in hpi-api-versions.txt */
#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(9, 0, 0)
Expand Down Expand Up @@ -1632,6 +1632,12 @@ u16 hpi_tuner_get_hd_radio_sdk_version(const struct hpi_hsubsys *ph_subsys,
u16 hpi_tuner_get_hd_radio_signal_quality(const struct hpi_hsubsys *ph_subsys,
u32 h_control, u32 *pquality);

u16 hpi_tuner_get_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
u32 h_control, u32 *pblend);

u16 hpi_tuner_set_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
u32 h_control, const u32 blend);

/****************************/
/* PADs control */
/****************************/
Expand Down
5 changes: 5 additions & 0 deletions sound/pci/asihpi/hpi_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ enum HPI_BUSES {
#define HPI_TUNER_HDRADIO_SDK_VERSION HPI_CTL_ATTR(TUNER, 13)
/** HD Radio DSP firmware version. */
#define HPI_TUNER_HDRADIO_DSP_VERSION HPI_CTL_ATTR(TUNER, 14)
/** HD Radio signal blend (force analog, or automatic). */
#define HPI_TUNER_HDRADIO_BLEND HPI_CTL_ATTR(TUNER, 15)

/** \} */

Expand Down Expand Up @@ -478,8 +480,10 @@ Threshold is a -ve number in units of dB/100,

/** First 2 hex digits define the adapter family */
#define HPI_ADAPTER_FAMILY_MASK 0xff00
#define HPI_MODULE_FAMILY_MASK 0xfff0

#define HPI_ADAPTER_FAMILY_ASI(f) (f & HPI_ADAPTER_FAMILY_MASK)
#define HPI_MODULE_FAMILY_ASI(f) (f & HPI_MODULE_FAMILY_MASK)
#define HPI_ADAPTER_ASI(f) (f)

/******************************************* message types */
Expand Down Expand Up @@ -970,6 +974,7 @@ struct hpi_control_union_msg {
u32 mode;
u32 value;
} mode;
u32 blend;
} tuner;
} u;
};
Expand Down
17 changes: 15 additions & 2 deletions sound/pci/asihpi/hpifunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2946,6 +2946,20 @@ u16 hpi_tuner_get_hd_radio_signal_quality(const struct hpi_hsubsys *ph_subsys,
HPI_TUNER_HDRADIO_SIGNAL_QUALITY, 0, 0, pquality, NULL);
}

u16 hpi_tuner_get_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
u32 h_control, u32 *pblend)
{
return hpi_control_param_get(ph_subsys, h_control,
HPI_TUNER_HDRADIO_BLEND, 0, 0, pblend, NULL);
}

u16 hpi_tuner_set_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys,
u32 h_control, const u32 blend)
{
return hpi_control_param_set(ph_subsys, h_control,
HPI_TUNER_HDRADIO_BLEND, blend, 0);
}

u16 hpi_tuner_getRDS(const struct hpi_hsubsys *ph_subsys, u32 h_control,
char *p_data)
{
Expand Down Expand Up @@ -3266,8 +3280,7 @@ u16 hpi_entity_find_next(struct hpi_entity *container_entity,

void hpi_entity_free(struct hpi_entity *entity)
{
if (entity != NULL)
kfree(entity);
kfree(entity);
}

static u16 hpi_entity_alloc_and_copy(struct hpi_entity *src,
Expand Down

0 comments on commit 5a498ef

Please sign in to comment.