0315-Revert-bcm2835-implement-channel-map-API.patch 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. From 321cf99bd2206e741a89b5ac350dfe3f182a00a3 Mon Sep 17 00:00:00 2001
  2. From: popcornmix <popcornmix@gmail.com>
  3. Date: Fri, 29 Apr 2016 17:29:03 +0100
  4. Subject: [PATCH] Revert "bcm2835: implement channel map API"
  5. This reverts commit 5efba3f8c180c39609a8d40033ef92046ef0de75.
  6. ---
  7. sound/arm/bcm2835-ctl.c | 299 ----------------------------------------------
  8. sound/arm/bcm2835-pcm.c | 69 ++---------
  9. sound/arm/bcm2835-vchiq.c | 13 --
  10. sound/arm/bcm2835.h | 4 -
  11. 4 files changed, 7 insertions(+), 378 deletions(-)
  12. --- a/sound/arm/bcm2835-ctl.c
  13. +++ b/sound/arm/bcm2835-ctl.c
  14. @@ -327,304 +327,6 @@ static struct snd_kcontrol_new snd_bcm28
  15. },
  16. };
  17. -struct cea_channel_speaker_allocation {
  18. - int ca_index;
  19. - int speakers[8];
  20. -};
  21. -
  22. -#define FL SNDRV_CHMAP_FL
  23. -#define FR SNDRV_CHMAP_FR
  24. -#define RL SNDRV_CHMAP_RL
  25. -#define RR SNDRV_CHMAP_RR
  26. -#define LFE SNDRV_CHMAP_LFE
  27. -#define FC SNDRV_CHMAP_FC
  28. -#define RLC SNDRV_CHMAP_RLC
  29. -#define RRC SNDRV_CHMAP_RRC
  30. -#define RC SNDRV_CHMAP_RC
  31. -#define FLC SNDRV_CHMAP_FLC
  32. -#define FRC SNDRV_CHMAP_FRC
  33. -#define FLH SNDRV_CHMAP_TFL
  34. -#define FRH SNDRV_CHMAP_TFR
  35. -#define FLW SNDRV_CHMAP_FLW
  36. -#define FRW SNDRV_CHMAP_FRW
  37. -#define TC SNDRV_CHMAP_TC
  38. -#define FCH SNDRV_CHMAP_TFC
  39. -
  40. -/*
  41. - * CEA-861 channel maps
  42. - *
  43. - * Stolen from sound/pci/hda/patch_hdmi.c
  44. - * (unlike the source, this uses SNDRV_* constants directly, as by the
  45. - * map_tables array in patch_hdmi.c)
  46. - * Unknown entries use 0, which unfortunately is SNDRV_CHMAP_UNKNOWN instead
  47. - * of SNDRV_CHMAP_NA.
  48. - */
  49. -static struct cea_channel_speaker_allocation channel_allocations[] = {
  50. -/* channel: 7 6 5 4 3 2 1 0 */
  51. -{ .ca_index = 0x00, .speakers = { 0, 0, 0, 0, 0, 0, FR, FL } },
  52. - /* 2.1 */
  53. -{ .ca_index = 0x01, .speakers = { 0, 0, 0, 0, 0, LFE, FR, FL } },
  54. - /* Dolby Surround */
  55. -{ .ca_index = 0x02, .speakers = { 0, 0, 0, 0, FC, 0, FR, FL } },
  56. - /* surround40 */
  57. -{ .ca_index = 0x08, .speakers = { 0, 0, RR, RL, 0, 0, FR, FL } },
  58. - /* surround41 */
  59. -{ .ca_index = 0x09, .speakers = { 0, 0, RR, RL, 0, LFE, FR, FL } },
  60. - /* surround50 */
  61. -{ .ca_index = 0x0a, .speakers = { 0, 0, RR, RL, FC, 0, FR, FL } },
  62. - /* surround51 */
  63. -{ .ca_index = 0x0b, .speakers = { 0, 0, RR, RL, FC, LFE, FR, FL } },
  64. - /* 6.1 */
  65. -{ .ca_index = 0x0f, .speakers = { 0, RC, RR, RL, FC, LFE, FR, FL } },
  66. - /* surround71 */
  67. -{ .ca_index = 0x13, .speakers = { RRC, RLC, RR, RL, FC, LFE, FR, FL } },
  68. -
  69. -{ .ca_index = 0x03, .speakers = { 0, 0, 0, 0, FC, LFE, FR, FL } },
  70. -{ .ca_index = 0x04, .speakers = { 0, 0, 0, RC, 0, 0, FR, FL } },
  71. -{ .ca_index = 0x05, .speakers = { 0, 0, 0, RC, 0, LFE, FR, FL } },
  72. -{ .ca_index = 0x06, .speakers = { 0, 0, 0, RC, FC, 0, FR, FL } },
  73. -{ .ca_index = 0x07, .speakers = { 0, 0, 0, RC, FC, LFE, FR, FL } },
  74. -{ .ca_index = 0x0c, .speakers = { 0, RC, RR, RL, 0, 0, FR, FL } },
  75. -{ .ca_index = 0x0d, .speakers = { 0, RC, RR, RL, 0, LFE, FR, FL } },
  76. -{ .ca_index = 0x0e, .speakers = { 0, RC, RR, RL, FC, 0, FR, FL } },
  77. -{ .ca_index = 0x10, .speakers = { RRC, RLC, RR, RL, 0, 0, FR, FL } },
  78. -{ .ca_index = 0x11, .speakers = { RRC, RLC, RR, RL, 0, LFE, FR, FL } },
  79. -{ .ca_index = 0x12, .speakers = { RRC, RLC, RR, RL, FC, 0, FR, FL } },
  80. -{ .ca_index = 0x14, .speakers = { FRC, FLC, 0, 0, 0, 0, FR, FL } },
  81. -{ .ca_index = 0x15, .speakers = { FRC, FLC, 0, 0, 0, LFE, FR, FL } },
  82. -{ .ca_index = 0x16, .speakers = { FRC, FLC, 0, 0, FC, 0, FR, FL } },
  83. -{ .ca_index = 0x17, .speakers = { FRC, FLC, 0, 0, FC, LFE, FR, FL } },
  84. -{ .ca_index = 0x18, .speakers = { FRC, FLC, 0, RC, 0, 0, FR, FL } },
  85. -{ .ca_index = 0x19, .speakers = { FRC, FLC, 0, RC, 0, LFE, FR, FL } },
  86. -{ .ca_index = 0x1a, .speakers = { FRC, FLC, 0, RC, FC, 0, FR, FL } },
  87. -{ .ca_index = 0x1b, .speakers = { FRC, FLC, 0, RC, FC, LFE, FR, FL } },
  88. -{ .ca_index = 0x1c, .speakers = { FRC, FLC, RR, RL, 0, 0, FR, FL } },
  89. -{ .ca_index = 0x1d, .speakers = { FRC, FLC, RR, RL, 0, LFE, FR, FL } },
  90. -{ .ca_index = 0x1e, .speakers = { FRC, FLC, RR, RL, FC, 0, FR, FL } },
  91. -{ .ca_index = 0x1f, .speakers = { FRC, FLC, RR, RL, FC, LFE, FR, FL } },
  92. -{ .ca_index = 0x20, .speakers = { 0, FCH, RR, RL, FC, 0, FR, FL } },
  93. -{ .ca_index = 0x21, .speakers = { 0, FCH, RR, RL, FC, LFE, FR, FL } },
  94. -{ .ca_index = 0x22, .speakers = { TC, 0, RR, RL, FC, 0, FR, FL } },
  95. -{ .ca_index = 0x23, .speakers = { TC, 0, RR, RL, FC, LFE, FR, FL } },
  96. -{ .ca_index = 0x24, .speakers = { FRH, FLH, RR, RL, 0, 0, FR, FL } },
  97. -{ .ca_index = 0x25, .speakers = { FRH, FLH, RR, RL, 0, LFE, FR, FL } },
  98. -{ .ca_index = 0x26, .speakers = { FRW, FLW, RR, RL, 0, 0, FR, FL } },
  99. -{ .ca_index = 0x27, .speakers = { FRW, FLW, RR, RL, 0, LFE, FR, FL } },
  100. -{ .ca_index = 0x28, .speakers = { TC, RC, RR, RL, FC, 0, FR, FL } },
  101. -{ .ca_index = 0x29, .speakers = { TC, RC, RR, RL, FC, LFE, FR, FL } },
  102. -{ .ca_index = 0x2a, .speakers = { FCH, RC, RR, RL, FC, 0, FR, FL } },
  103. -{ .ca_index = 0x2b, .speakers = { FCH, RC, RR, RL, FC, LFE, FR, FL } },
  104. -{ .ca_index = 0x2c, .speakers = { TC, FCH, RR, RL, FC, 0, FR, FL } },
  105. -{ .ca_index = 0x2d, .speakers = { TC, FCH, RR, RL, FC, LFE, FR, FL } },
  106. -{ .ca_index = 0x2e, .speakers = { FRH, FLH, RR, RL, FC, 0, FR, FL } },
  107. -{ .ca_index = 0x2f, .speakers = { FRH, FLH, RR, RL, FC, LFE, FR, FL } },
  108. -{ .ca_index = 0x30, .speakers = { FRW, FLW, RR, RL, FC, 0, FR, FL } },
  109. -{ .ca_index = 0x31, .speakers = { FRW, FLW, RR, RL, FC, LFE, FR, FL } },
  110. -};
  111. -
  112. -static int snd_bcm2835_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag,
  113. - unsigned int size, unsigned int __user *tlv)
  114. -{
  115. - unsigned int __user *dst;
  116. - int count = 0;
  117. - int i;
  118. -
  119. - if (size < 8)
  120. - return -ENOMEM;
  121. - if (put_user(SNDRV_CTL_TLVT_CONTAINER, tlv))
  122. - return -EFAULT;
  123. - size -= 8;
  124. - dst = tlv + 2;
  125. - for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
  126. - struct cea_channel_speaker_allocation *ch = &channel_allocations[i];
  127. - int num_chs = 0;
  128. - int chs_bytes;
  129. - int c;
  130. -
  131. - for (c = 0; c < 8; c++) {
  132. - if (ch->speakers[c])
  133. - num_chs++;
  134. - }
  135. -
  136. - chs_bytes = num_chs * 4;
  137. - if (size < 8)
  138. - return -ENOMEM;
  139. - if (put_user(SNDRV_CTL_TLVT_CHMAP_FIXED, dst) ||
  140. - put_user(chs_bytes, dst + 1))
  141. - return -EFAULT;
  142. - dst += 2;
  143. - size -= 8;
  144. - count += 8;
  145. - if (size < chs_bytes)
  146. - return -ENOMEM;
  147. - size -= chs_bytes;
  148. - count += chs_bytes;
  149. - for (c = 0; c < 8; c++) {
  150. - int sp = ch->speakers[7 - c];
  151. - if (sp) {
  152. - if (put_user(sp, dst))
  153. - return -EFAULT;
  154. - dst++;
  155. - }
  156. - }
  157. - }
  158. - if (put_user(count, tlv + 1))
  159. - return -EFAULT;
  160. - return 0;
  161. -}
  162. -
  163. -static int snd_bcm2835_chmap_ctl_get(struct snd_kcontrol *kcontrol,
  164. - struct snd_ctl_elem_value *ucontrol)
  165. -{
  166. - struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
  167. - bcm2835_chip_t *chip = info->private_data;
  168. - unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  169. - struct snd_pcm_substream *substream = snd_pcm_chmap_substream(info, idx);
  170. - struct cea_channel_speaker_allocation *ch = NULL;
  171. - int res = 0;
  172. - int cur = 0;
  173. - int i;
  174. -
  175. - if (mutex_lock_interruptible(&chip->audio_mutex))
  176. - return -EINTR;
  177. -
  178. - if (!substream || !substream->runtime) {
  179. - res = -ENODEV;
  180. - goto unlock;
  181. - }
  182. -
  183. - for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
  184. - if (channel_allocations[i].ca_index == chip->cea_chmap)
  185. - ch = &channel_allocations[i];
  186. - }
  187. -
  188. - /* If no layout was set yet, return a dummy. Apparently the userspace
  189. - * API will be confused if we don't. */
  190. - if (!ch)
  191. - ch = &channel_allocations[0];
  192. -
  193. - for (i = 0; i < 8; i++) {
  194. - if (ch->speakers[7 - i])
  195. - ucontrol->value.integer.value[cur++] = ch->speakers[7 - i];
  196. - }
  197. - while (cur < 8)
  198. - ucontrol->value.integer.value[cur++] = SNDRV_CHMAP_NA;
  199. -
  200. -unlock:
  201. - mutex_unlock(&chip->audio_mutex);
  202. - return res;
  203. -}
  204. -
  205. -static int snd_bcm2835_chmap_ctl_put(struct snd_kcontrol *kcontrol,
  206. - struct snd_ctl_elem_value *ucontrol)
  207. -{
  208. - struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
  209. - bcm2835_chip_t *chip = info->private_data;
  210. - unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
  211. - struct snd_pcm_substream *substream = snd_pcm_chmap_substream(info, idx);
  212. - int i, prepared = 0, cea_chmap = -1;
  213. - int res = 0;
  214. - int remap[8];
  215. -
  216. - if (mutex_lock_interruptible(&chip->audio_mutex))
  217. - return -EINTR;
  218. -
  219. - if (!substream || !substream->runtime) {
  220. - res = -ENODEV;
  221. - goto unlock;
  222. - }
  223. -
  224. - switch (substream->runtime->status->state) {
  225. - case SNDRV_PCM_STATE_OPEN:
  226. - case SNDRV_PCM_STATE_SETUP:
  227. - break;
  228. - case SNDRV_PCM_STATE_PREPARED:
  229. - prepared = 1;
  230. - break;
  231. - default:
  232. - res = -EBUSY;
  233. - goto unlock;
  234. - }
  235. -
  236. - for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
  237. - struct cea_channel_speaker_allocation *ch = &channel_allocations[i];
  238. - int matches = 1;
  239. - int cur = 0;
  240. - int x;
  241. - memset(remap, 0, sizeof(remap));
  242. - for (x = 0; x < substream->runtime->channels; x++) {
  243. - int sp = ucontrol->value.integer.value[x];
  244. - while (cur < 8 && !ch->speakers[7 - cur])
  245. - cur++;
  246. - if (cur >= 8) {
  247. - /* user has more channels than ch */
  248. - matches = 0;
  249. - break;
  250. - }
  251. - if (ch->speakers[7 - cur] != sp) {
  252. - matches = 0;
  253. - break;
  254. - }
  255. - remap[x] = cur;
  256. - cur++;
  257. - }
  258. - for (x = cur; x < 8; x++) {
  259. - if (ch->speakers[7 - x]) {
  260. - /* ch has more channels than user */
  261. - matches = 0;
  262. - break;
  263. - }
  264. - }
  265. - if (matches) {
  266. - cea_chmap = ch->ca_index;
  267. - break;
  268. - }
  269. - }
  270. -
  271. - if (cea_chmap < 0) {
  272. - res = -EINVAL;
  273. - goto unlock;
  274. - }
  275. -
  276. - /* don't change the layout if another substream is active */
  277. - if (chip->opened != (1 << substream->number) && chip->cea_chmap != cea_chmap) {
  278. - res = -EBUSY; /* unsure whether this is a good error code */
  279. - goto unlock;
  280. - }
  281. -
  282. - chip->cea_chmap = cea_chmap;
  283. - for (i = 0; i < 8; i++)
  284. - chip->map_channels[i] = remap[i];
  285. - if (prepared)
  286. - snd_bcm2835_pcm_prepare_again(substream);
  287. -
  288. -unlock:
  289. - mutex_unlock(&chip->audio_mutex);
  290. - return res;
  291. -}
  292. -
  293. -static int snd_bcm2835_add_chmap_ctl(bcm2835_chip_t * chip)
  294. -{
  295. - struct snd_pcm_chmap *chmap;
  296. - struct snd_kcontrol *kctl;
  297. - int err, i;
  298. -
  299. - err = snd_pcm_add_chmap_ctls(chip->pcm,
  300. - SNDRV_PCM_STREAM_PLAYBACK,
  301. - NULL, 8, 0, &chmap);
  302. - if (err < 0)
  303. - return err;
  304. - /* override handlers */
  305. - chmap->private_data = chip;
  306. - kctl = chmap->kctl;
  307. - for (i = 0; i < kctl->count; i++)
  308. - kctl->vd[i].access |= SNDRV_CTL_ELEM_ACCESS_WRITE;
  309. - kctl->get = snd_bcm2835_chmap_ctl_get;
  310. - kctl->put = snd_bcm2835_chmap_ctl_put;
  311. - kctl->tlv.c = snd_bcm2835_chmap_ctl_tlv;
  312. - return 0;
  313. -}
  314. -
  315. int snd_bcm2835_new_ctl(bcm2835_chip_t * chip)
  316. {
  317. int err;
  318. @@ -638,7 +340,6 @@ int snd_bcm2835_new_ctl(bcm2835_chip_t *
  319. if (err < 0)
  320. return err;
  321. }
  322. - snd_bcm2835_add_chmap_ctl(chip);
  323. for (idx = 0; idx < ARRAY_SIZE(snd_bcm2835_spdif); idx++) {
  324. err = snd_ctl_add(chip->card,
  325. snd_ctl_new1(&snd_bcm2835_spdif[idx], chip));
  326. --- a/sound/arm/bcm2835-pcm.c
  327. +++ b/sound/arm/bcm2835-pcm.c
  328. @@ -19,9 +19,6 @@
  329. #include "bcm2835.h"
  330. -/* The hardware can not do much more num_channels*samplerate then this value */
  331. -#define MAX_COMBINED_RATE 768000
  332. -
  333. /* hardware definition */
  334. static struct snd_pcm_hardware snd_bcm2835_playback_hw = {
  335. .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
  336. @@ -110,31 +107,6 @@ static irqreturn_t bcm2835_playback_fifo
  337. return IRQ_HANDLED;
  338. }
  339. -
  340. -static int rate_hw_constraint_rate(struct snd_pcm_hw_params *params,
  341. - struct snd_pcm_hw_rule *rule)
  342. -{
  343. - struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
  344. - struct snd_interval rates = {
  345. - .min = 8000,
  346. - .max = min(192000u, MAX_COMBINED_RATE / max(channels->min, 1u)),
  347. - };
  348. - struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
  349. - return snd_interval_refine(rate, &rates);
  350. -}
  351. -
  352. -static int rate_hw_constraint_channels(struct snd_pcm_hw_params *params,
  353. - struct snd_pcm_hw_rule *rule)
  354. -{
  355. - struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
  356. - struct snd_interval channels_interval = {
  357. - .min = 1,
  358. - .max = min(8u, MAX_COMBINED_RATE / max(rate->min, 1u)),
  359. - };
  360. - struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
  361. - return snd_interval_refine(channels, &channels_interval);
  362. -}
  363. -
  364. /* open callback */
  365. static int snd_bcm2835_playback_open_generic(
  366. struct snd_pcm_substream *substream, int spdif)
  367. @@ -216,24 +188,8 @@ static int snd_bcm2835_playback_open_gen
  368. snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
  369. 16);
  370. - /* When playing PCM, pretend that we support the full range of channels
  371. - * and sample rates. The GPU can't output it, but is able to resample
  372. - * the data to a rate the hardware can handle it. This won't work with
  373. - * compressed data; the resampler would just destroy it. */
  374. - if (spdif) {
  375. - err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
  376. - rate_hw_constraint_rate, NULL,
  377. - SNDRV_PCM_HW_PARAM_CHANNELS, -1);
  378. - err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
  379. - rate_hw_constraint_channels, NULL,
  380. - SNDRV_PCM_HW_PARAM_RATE, -1);
  381. - }
  382. -
  383. chip->alsa_stream[idx] = alsa_stream;
  384. - if (!chip->opened)
  385. - chip->cea_chmap = -1;
  386. -
  387. chip->opened |= (1 << idx);
  388. alsa_stream->open = 1;
  389. alsa_stream->draining = 1;
  390. @@ -344,7 +300,8 @@ static int snd_bcm2835_pcm_hw_free(struc
  391. return snd_pcm_lib_free_pages(substream);
  392. }
  393. -int snd_bcm2835_pcm_prepare_again(struct snd_pcm_substream *substream)
  394. +/* prepare callback */
  395. +static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
  396. {
  397. bcm2835_chip_t *chip = snd_pcm_substream_chip(substream);
  398. struct snd_pcm_runtime *runtime = substream->runtime;
  399. @@ -352,6 +309,11 @@ int snd_bcm2835_pcm_prepare_again(struct
  400. int channels;
  401. int err;
  402. + audio_info(" .. IN\n");
  403. +
  404. + if (mutex_lock_interruptible(&chip->audio_mutex))
  405. + return -EINTR;
  406. +
  407. /* notify the vchiq that it should enter spdif passthrough mode by
  408. * setting channels=0 (see
  409. * https://github.com/raspberrypi/linux/issues/528) */
  410. @@ -367,23 +329,6 @@ int snd_bcm2835_pcm_prepare_again(struct
  411. audio_error(" error setting hw params\n");
  412. }
  413. - return err;
  414. -}
  415. -
  416. -/* prepare callback */
  417. -static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
  418. -{
  419. - bcm2835_chip_t *chip = snd_pcm_substream_chip(substream);
  420. - struct snd_pcm_runtime *runtime = substream->runtime;
  421. - bcm2835_alsa_stream_t *alsa_stream = runtime->private_data;
  422. -
  423. - audio_info(" .. IN\n");
  424. -
  425. - if (mutex_lock_interruptible(&chip->audio_mutex))
  426. - return -EINTR;
  427. -
  428. - snd_bcm2835_pcm_prepare_again(substream);
  429. -
  430. bcm2835_audio_setup(alsa_stream);
  431. /* in preparation of the stream, set the controls (volume level) of the stream */
  432. --- a/sound/arm/bcm2835-vchiq.c
  433. +++ b/sound/arm/bcm2835-vchiq.c
  434. @@ -570,8 +570,6 @@ int bcm2835_audio_set_params(bcm2835_als
  435. VC_AUDIO_MSG_T m;
  436. AUDIO_INSTANCE_T *instance = alsa_stream->instance;
  437. int32_t success;
  438. - uint32_t chmap_value;
  439. - int i;
  440. int ret;
  441. LOG_DBG(" .. IN\n");
  442. @@ -595,21 +593,10 @@ int bcm2835_audio_set_params(bcm2835_als
  443. instance->result = -1;
  444. - if (alsa_stream->chip->cea_chmap >= 0) {
  445. - chmap_value = (unsigned)alsa_stream->chip->cea_chmap << 24;
  446. - } else {
  447. - chmap_value = 0; /* force stereo */
  448. - for (i = 0; i < 8; i++)
  449. - alsa_stream->chip->map_channels[i] = i;
  450. - }
  451. - for (i = 0; i < 8; i++)
  452. - chmap_value |= alsa_stream->chip->map_channels[i] << (i * 3);
  453. -
  454. m.type = VC_AUDIO_MSG_TYPE_CONFIG;
  455. m.u.config.channels = channels;
  456. m.u.config.samplerate = samplerate;
  457. m.u.config.bps = bps;
  458. - m.u.config.channelmap = chmap_value;
  459. /* Create the message available completion */
  460. init_completion(&instance->msg_avail_comp);
  461. --- a/sound/arm/bcm2835.h
  462. +++ b/sound/arm/bcm2835.h
  463. @@ -107,8 +107,6 @@ typedef struct bcm2835_chip {
  464. int old_volume; /* stores the volume value whist muted */
  465. int dest;
  466. int mute;
  467. - int cea_chmap; /* currently requested Audio InfoFrame Data Byte 4 */
  468. - int map_channels[8];
  469. unsigned int opened;
  470. unsigned int spdif_status;
  471. @@ -151,8 +149,6 @@ int snd_bcm2835_new_ctl(bcm2835_chip_t *
  472. int snd_bcm2835_new_pcm(bcm2835_chip_t * chip);
  473. int snd_bcm2835_new_spdif_pcm(bcm2835_chip_t * chip);
  474. -int snd_bcm2835_pcm_prepare_again(struct snd_pcm_substream *substream);
  475. -
  476. int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream);
  477. int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream);
  478. int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream,