linux-4.4.1/snd_soc_read_signed()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#nbdfba83]
#backlinks
*説明 [#u013710e]
-パス: [[linux-4.4.1/sound/soc/soc-ops.c]]
-FIXME: これは何?
--説明
**引数 [#k173ab85]
-struct snd_soc_component *component
--
--[[linux-4.4.1/snd_soc_component]]
-unsigned int reg
--
-unsigned int mask
--
-unsigned int shift
--
-unsigned int sign_bit
--
-int *signed_val
--
**返り値 [#cc9286ce]
-int
--
**参考 [#ef4d8b3f]
*実装 [#w36a7940]
/**
* snd_soc_read_signed - Read a codec register and inter...
* @component: component
* @reg: Register to read
* @mask: Mask to use after shifting the register value
* @shift: Right shift of register value
* @sign_bit: Bit that describes if a number is negative...
* @signed_val: Pointer to where the read value should b...
*
* This functions reads a codec register. The register v...
* by 'shift' bits and masked with the given 'mask'. Aft...
* the given registervalue into a signed integer if sign...
*
* Returns 0 on sucess, otherwise an error value
*/
static int snd_soc_read_signed(struct snd_soc_component ...
unsigned int reg, unsigned int mask, unsigned in...
unsigned int sign_bit, int *signed_val)
{
int ret;
unsigned int val;
ret = snd_soc_component_read(component, reg, &va...
if (ret < 0)
return ret;
-
--[[linux-4.4.1/snd_soc_component_read()]]
val = (val >> shift) & mask;
if (!sign_bit) {
*signed_val = val;
return 0;
}
/* non-negative number */
if (!(val & BIT(sign_bit))) {
*signed_val = val;
return 0;
}
-
--[[linux-4.4.1/BIT()]]
ret = val;
/*
* The register most probably does not contain a...
* Instead we have an arbitrary number of bits i...
* representation which has to be translated int...
* This is done by filling up all bits above the...
*/
ret |= ~((int)(BIT(sign_bit) - 1));
*signed_val = ret;
return 0;
}
*コメント [#j2ca8cb2]
終了行:
*参照元 [#nbdfba83]
#backlinks
*説明 [#u013710e]
-パス: [[linux-4.4.1/sound/soc/soc-ops.c]]
-FIXME: これは何?
--説明
**引数 [#k173ab85]
-struct snd_soc_component *component
--
--[[linux-4.4.1/snd_soc_component]]
-unsigned int reg
--
-unsigned int mask
--
-unsigned int shift
--
-unsigned int sign_bit
--
-int *signed_val
--
**返り値 [#cc9286ce]
-int
--
**参考 [#ef4d8b3f]
*実装 [#w36a7940]
/**
* snd_soc_read_signed - Read a codec register and inter...
* @component: component
* @reg: Register to read
* @mask: Mask to use after shifting the register value
* @shift: Right shift of register value
* @sign_bit: Bit that describes if a number is negative...
* @signed_val: Pointer to where the read value should b...
*
* This functions reads a codec register. The register v...
* by 'shift' bits and masked with the given 'mask'. Aft...
* the given registervalue into a signed integer if sign...
*
* Returns 0 on sucess, otherwise an error value
*/
static int snd_soc_read_signed(struct snd_soc_component ...
unsigned int reg, unsigned int mask, unsigned in...
unsigned int sign_bit, int *signed_val)
{
int ret;
unsigned int val;
ret = snd_soc_component_read(component, reg, &va...
if (ret < 0)
return ret;
-
--[[linux-4.4.1/snd_soc_component_read()]]
val = (val >> shift) & mask;
if (!sign_bit) {
*signed_val = val;
return 0;
}
/* non-negative number */
if (!(val & BIT(sign_bit))) {
*signed_val = val;
return 0;
}
-
--[[linux-4.4.1/BIT()]]
ret = val;
/*
* The register most probably does not contain a...
* Instead we have an arbitrary number of bits i...
* representation which has to be translated int...
* This is done by filling up all bits above the...
*/
ret |= ~((int)(BIT(sign_bit) - 1));
*signed_val = ret;
return 0;
}
*コメント [#j2ca8cb2]
ページ名: