pcm: hw: add a helper function to query status/control data
When executing ioctl(2) with some commands, applications can request
ALSA PCM core to change appl_ptr in kernel space. Below is a list of
such operations:
- SNDRV_PCM_IOCTL_PREPARE
- SNDRV_PCM_IOCTL_RESET
- SNDRV_PCM_IOCTL_REWIND
- SNDRV_PCM_IOCTL_FORWARD
- SNDRV_PCM_IOCTL_WRITEI_FRAMES
- SNDRV_PCM_IOCTL_WRITEN_FRAMES
- SNDRV_PCM_IOCTL_READI_FRAMES
- SNDRV_PCM_IOCTL_READN_FRAMES
After these operations, the value of appl_ptr should be synchronized
between kernel/user spaces.
This commit adds a helper function to query status and control data
without issuing the control data just in fallback from failure of control
mapping.