[media] tw686x: audio: Allow to configure the period size

Currently, the driver has a fixed period size of 4096 bytes
(2048 frames). Since this hardware can configure the audio
capture size, this commit allows a period size range of [512-4096].

This is very useful to reduce the audio latency.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Ezequiel Garcia
2016-06-04 20:47:19 -03:00
committad av Mauro Carvalho Chehab
förälder c156c54d79
incheckning 447d7c3291
3 ändrade filer med 34 tillägg och 23 borttagningar

Visa fil

@@ -27,7 +27,6 @@
#define TYPE_SECOND_GEN 0x10
#define TW686X_DEF_PHASE_REF 0x1518
#define TW686X_AUDIO_PAGE_SZ 4096
#define TW686X_AUDIO_PAGE_MAX 16
#define TW686X_AUDIO_PERIODS_MIN 2
#define TW686X_AUDIO_PERIODS_MAX TW686X_AUDIO_PAGE_MAX
@@ -139,7 +138,9 @@ struct tw686x_dev {
struct tw686x_video_channel *video_channels;
struct tw686x_audio_channel *audio_channels;
int audio_rate; /* per-device value */
/* Per-device audio parameters */
int audio_rate;
int period_size;
struct timer_list dma_delay_timer;
u32 pending_dma_en; /* must be protected by lock */