Skip to content

Commit 0f81d23

Browse files
committed
miyoo: add separate MIYOO_TV_JACK_STATUS
the same as snd jack for every console without separate tvout jack
1 parent af6f9cf commit 0f81d23

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

sound/soc/suniv/miyoo.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#define MIYOO_SND_SET_VOLUME _IOWR(0x100, 0, unsigned long)
5757
#define MIYOO_SND_GET_VOLUME _IOWR(0x101, 0, unsigned long)
5858
#define MIYOO_SND_JACK_STATUS _IOWR(0x102, 0, unsigned long)
59+
#define MIYOO_TV_JACK_STATUS _IOWR(0x103, 0, unsigned long)
5960

6061
struct mypcm {
6162
uint32_t dma_period;
@@ -85,7 +86,9 @@ static struct class *myclass = NULL;
8586

8687
static unsigned long MIYOO_VOLUME = 5;
8788
static uint32_t miyoo_snd=1;
89+
static bool miyoo_tvjack=false;
8890
module_param(miyoo_snd,uint,0660);
91+
module_param(miyoo_tvjack,bool,0660);
8992

9093
static void suniv_ioremap(void)
9194
{
@@ -470,18 +473,29 @@ EXPORT_SYMBOL_GPL(MIYOO_DECREASE_VOLUME);
470473
static long myioctl(struct file *filp, unsigned int cmd, unsigned long arg)
471474
{
472475
uint32_t ret;
473-
bool miyoo_jack = false;
476+
bool jack = false;
477+
bool tvjack = false;
474478

475479
switch(cmd){
476480
case MIYOO_SND_JACK_STATUS:
477481
ret = readl(iomm.gpio + PA_DATA);
478-
if(ret & 4){
479-
miyoo_jack = false;
480-
}
481-
else{
482-
miyoo_jack = true;
482+
if(ret & 4)
483+
jack = false;
484+
else
485+
jack = true;
486+
ret = copy_to_user((void*)arg, &jack, sizeof(bool));
487+
break;
488+
case MIYOO_TV_JACK_STATUS:
489+
ret = readl(iomm.gpio + PA_DATA);
490+
if(miyoo_tvjack){
491+
// no info about separate tvjack PIN data
492+
} else {
493+
if(ret & 4)
494+
tvjack = false;
495+
else
496+
tvjack = true;
483497
}
484-
ret = copy_to_user((void*)arg, &miyoo_jack, sizeof(bool));
498+
ret = copy_to_user((void*)arg, &tvjack, sizeof(bool));
485499
break;
486500
case MIYOO_SND_SET_VOLUME:
487501
MIYOO_SET_VOLUME(arg);

0 commit comments

Comments
 (0)