[Arm-netbook] ALSA info - trying to get sound working
Luke Kenneth Casson Leighton
luke.leighton at googlemail.com
Fri Mar 26 14:48:58 GMT 2010
On Fri, Mar 26, 2010 at 12:28 AM, Frans Pop <elendil at planet.nl> wrote:
> On Thursday 25 March 2010, Luke Kenneth Casson Leighton wrote:
>> code goes something like this:
>
> Looks like you're onto something here.
>
>> R4 = s3c6410_ac97_read(NULL, 4);
>
> #define AC97_HEADPHONE 0x04 /* Headphone Volume (optional) */
>
> And headphone volume is the one of the alsa controls that does something.
>
>> R5 = s3c6410_ac97_read(NULL, 0x18);
>
> #define AC97_PCM 0x18 /* PCM Volume */
>
>> R2 = R4 << 17;
>> R2 >>= 17;
>
> What's this? Rounding off?
>
>> s3c6410_ac97_write(NULL, 4, R2);
>>
>> R2 = R5 << 17;
>> R2 >>= 17;
>>
>> s3c6410_ac97_write(NULL, 0x18, R2);
>>
>> it looks like the same in s3c24xx_pcm_close, except that it's <<19
>> and >>= 19 for the 2nd one, hard to tell with the assembler being 0x75
>> 0x20 0xff 0xe6 not properly disassembled.
>>
>> in open, those two bug-ugly calls are made _after_ the
>> snd_soc_set_runtime_hwparams.
>
> Could you translate this to a proper patch? I'd prefer if you do it as you
> can see the correct sequence of things.
mmrhhhm..
s3cdbg("Entered %s\n", __FUNCTION__);
+#ifdef CONFIG_MACH_CTPC89E
+ s3c_gpio_cfgpin(S3C_GPK13, S3C_GPK13_OUTP);
+ s3c_gpio_setpin(S3C_GPK13, 1);
+ soc_ac97_ops->write(NULL, soc_ac97_ops->read(NULL,
AC97_HEADPHONE)) & 0xffff);
+ soc_ac97_ops->write(NULL, soc_ac97_ops->read(NULL, AC97_PCM
)) & 0xffff);
+#endif
+
snd_soc_set_runtime_hwparams(substream, &s3c24xx_pcm_hardware);
prtd = kzalloc(sizeof(struct s3c24xx_runtime_data), GFP_KERNEL);
@@ -429,6 +438,11 @@ static int s3c24xx_pcm_close(struct
snd_pcm_substream *substream)
else
printk("s3c24xx_pcm_close called with prtd == NULL\n");
+#ifdef CONFIG_MACH_CTPC89E
+ soc_ac97_ops->write(NULL, soc_ac97_ops->read(NULL,
AC97_HEADPHONE)) & 0xffff);
+ soc_ac97_ops->write(NULL, soc_ac97_ops->read(NULL, AC97_PCM
)) & 0x3ffff);
+ s3c_gpio_cfgpin(S3C_GPK13, S3C_GPK13_OUTP);
+ s3c_gpio_setpin(S3C_GPK13, 0);
+#endif
More information about the Arm-netbook
mailing list