ASoC: Add MBHC and IRQ driver for WCD937X

Add MBHC and IRQ driver for tanggu codec.
MBHC and IRQ for tanggu are initialized from
core driver. IRQ driver uses REGMAP-IRQ
framework.

CRs-Fixed: 2281591
Change-Id: I06adb3081dd17f896b3e6a3ce0c4c46b5ef1cbea
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Bu işleme şunda yer alıyor:
Vatsal Bucha
2018-07-30 20:17:41 +05:30
ebeveyn 9b37ac95f1
işleme 92fad90ae5
5 değiştirilmiş dosya ile 1379 ekleme ve 6 silme

Dosyayı Görüntüle

@@ -0,0 +1,70 @@
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __WCD937X_MBHC_H__
#define __WCD937X_MBHC_H__
#include "../wcd-mbhc-v2.h"
struct wcd937x_mbhc {
struct wcd_mbhc wcd_mbhc;
struct blocking_notifier_head notifier;
struct fw_info *fw_data;
bool mbhc_started;
};
#if IS_ENABLED(CONFIG_SND_SOC_WCD937X)
extern int wcd937x_mbhc_init(struct wcd937x_mbhc **mbhc,
struct snd_soc_codec *codec,
struct fw_info *fw_data);
extern void wcd937x_mbhc_hs_detect_exit(struct snd_soc_codec *codec);
extern int wcd937x_mbhc_hs_detect(struct snd_soc_codec *codec,
struct wcd_mbhc_config *mbhc_cfg);
extern void wcd937x_mbhc_deinit(struct snd_soc_codec *codec);
extern int wcd937x_mbhc_post_ssr_init(struct wcd937x_mbhc *mbhc,
struct snd_soc_codec *codec);
extern int wcd937x_mbhc_get_impedance(struct wcd937x_mbhc *wcd937x_mbhc,
uint32_t *zl, uint32_t *zr);
#else
static inline int wcd937x_mbhc_init(struct wcd937x_mbhc **mbhc,
struct snd_soc_codec *codec,
struct fw_info *fw_data)
{
return 0;
}
static inline void wcd937x_mbhc_hs_detect_exit(struct snd_soc_codec *codec)
{
}
static inline int wcd937x_mbhc_hs_detect(struct snd_soc_codec *codec,
struct wcd_mbhc_config *mbhc_cfg)
{
return 0;
}
static inline void wcd937x_mbhc_deinit(struct snd_soc_codec *codec)
{
}
static inline int wcd937x_mbhc_post_ssr_init(struct wcd937x_mbhc *mbhc,
struct snd_soc_codec *codec)
{
return 0;
}
static inline int wcd937x_mbhc_get_impedance(struct wcd937x_mbhc *wcd937x_mbhc,
uint32_t *zl, uint32_t *zr)
{
if (zl)
*zl = 0;
if (zr)
*zr = 0;
return -EINVAL;
}
#endif
#endif /* __WCD937X_MBHC_H__ */