Skip to content

Commit 1b77bc7

Browse files
authored
Merge pull request #4 from mczerski/sc2_dvb_support
SC2 dvb support
2 parents a260d37 + eddc7c3 commit 1b77bc7

File tree

10 files changed

+149
-18
lines changed

10 files changed

+149
-18
lines changed

arch/arm64/boot/dts/amlogic/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ dtb-y += sc2_s905x4_buzztv_x5_2g.dtb
7777
dtb-y += sc2_s905x4_buzztv_x5_2g_1gbit.dtb
7878
dtb-y += sc2_s905x4_buzztv_x5_4g.dtb
7979
dtb-y += sc2_s905x4_buzztv_x5_4g_1gbit.dtb
80+
dtb-y += sc2_s905x4_mecool_kt1.dtb
8081
dtb-y += sc2_s905x4_sei_smb_280_id5.dtb
8182
dtb-y += sc2_s905x4_sei_smb_280_id6.dtb
8283
dtb-y += sc2_s905x4_sei_smb_280_id7.dtb

arch/arm64/boot/dts/amlogic/coreelec_common.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
pinctrl-0 = <&remote_pins>;
7272
protocol = <REMOTE_TYPE_NEC>;
7373
max_frame_time = <200>; /*set software decoder max frame time*/
74+
led_blink = <1>;
7475
};
7576

7677
openvfd {

arch/arm64/boot/dts/amlogic/coreelec_sc2_common.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@
128128
key_name = "power";
129129
key_code = <116>;
130130
};
131+
132+
/delete-node/ gpio_leds;
131133
};
132134

133135
&aml_wifi {
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#include "sc2_s905x4_ah212_drm.dts"
2+
#include "coreelec_sc2_common.dtsi"
3+
4+
/ {
5+
model = "Mecool KT1";
6+
coreelec-dt-id = "sc2_s905x4_mecool_kt1";
7+
8+
auge_sound {
9+
/delete-property/ avout_mute-gpios;
10+
};
11+
12+
gpioleds {
13+
sys_led {
14+
label = "sys_led";
15+
gpios = <&gpio GPIOD_11 GPIO_ACTIVE_HIGH>;
16+
linux,default-trigger = "default-on";
17+
};
18+
net_led {
19+
label = "net_led";
20+
gpios=<&gpio GPIOD_4 GPIO_ACTIVE_HIGH>;
21+
linux,default-trigger = "none";
22+
};
23+
rc_led {
24+
label = "rc_led";
25+
gpios=<&gpio GPIOD_6 GPIO_ACTIVE_HIGH>;
26+
linux,default-trigger = "rc-feedback";
27+
};
28+
};
29+
30+
gpio_keypad {
31+
status = "disabled";
32+
};
33+
34+
/delete-node/ dvb-extern;
35+
dvb-extern {
36+
compatible = "amlogic, dvb-extern";
37+
dev_name = "dvb-extern";
38+
status = "okay";
39+
40+
fe_num = <1>;
41+
fe0_demod = "avl68xx";
42+
fe0_i2c_adap_id = <&i2c3>;
43+
fe0_demod_i2c_addr = <0x14>;
44+
fe0_ts_out_mode = <1>;
45+
fe0_ts = <1>;
46+
fe0_tuner0 = <0>;
47+
48+
tuner_num = <1>;
49+
tuner0_name = "mxl603_tuner";
50+
tuner0_i2c_adap = <&i2c3>;
51+
tuner0_i2c_addr = <0x60>;
52+
tuner0_xtal = <0>;
53+
tuner0_if_hz = <6>;
54+
tuner0_if_agc = <0>;
55+
tuner0_xtal_cap = <25>;
56+
tuner0_if_invert = <1>;
57+
tuner0_lt_out = <0>;
58+
tuner0_xtal_mode = <0>;
59+
tuner0_dual_power = <0>;
60+
};
61+
62+
/delete-node/ dvb-demux;
63+
dvb-demux {
64+
compatible = "amlogic sc2, dvb-demux";
65+
dev_name = "dvb-demux";
66+
status = "okay";
67+
68+
reg = <0x0 0xfe000000 0x0 0x480000>;
69+
70+
dmxdev_num = <3>;
71+
72+
tsn_from = "demod";
73+
ts_clone = <0>;
74+
tee_compat = <1>;
75+
76+
ts1_sid = <0x20>;
77+
ts1 = "parallel";
78+
ts1_control = <0>;
79+
ts1_invert = <0>;
80+
81+
pinctrl-names = "p_ts1";
82+
pinctrl-0 = <&dvb_p_ts1_pins>;
83+
};
84+
};
85+
86+
&i2c2 {
87+
status = "disabled";
88+
};
89+
90+
&i2c3 {
91+
status = "okay";
92+
};
93+
94+
&sd_emmc_b {
95+
max-frequency = <150000000>;
96+
};
97+
98+
&periphs_pinctrl {
99+
dvb_p_ts1_pins: dvb_p_ts1_pins {
100+
tsin_b {
101+
groups = "tsin_b_sop",
102+
"tsin_b_valid",
103+
"tsin_b_clk",
104+
"tsin_b_fail",
105+
"tsin_b_din0",
106+
"tsin_b_din1",
107+
"tsin_b_din2",
108+
"tsin_b_din3",
109+
"tsin_b_din4",
110+
"tsin_b_din5",
111+
"tsin_b_din6",
112+
"tsin_b_din7";
113+
function = "tsin_b";
114+
};
115+
};
116+
};

arch/arm64/boot/dts/amlogic/sc2_s905x4_ugoos_x4.dts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
model = "Ugoos X4";
55
coreelec-dt-id = "sc2_s905x4_ugoos_x4";
66

7-
/delete-node/ gpio_leds;
8-
97
gpioleds {
108
/delete-node/ net_red;
119
/delete-node/ net_green;

drivers/dvb/aml_dtvdemod.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ static const struct demod_module demod_modules[] = {
3939
.register_frontend = aml_dvb_register_frontend,
4040
.unregister_frontend = aml_dvb_unregister_frontend
4141
},
42-
#ifdef DEMOD_UNUSED
4342
{
4443
.name = "m1",
4544
.id = AM_DTV_DEMOD_M1,
@@ -64,7 +63,6 @@ static const struct demod_module demod_modules[] = {
6463
.register_frontend = aml_dvb_register_frontend,
6564
.unregister_frontend = aml_dvb_unregister_frontend
6665
},
67-
#endif //DEMOD_UNUSED
6866
{
6967
.name = "avl6211",
7068
.id = AM_DTV_DEMOD_AVL6211,
@@ -89,7 +87,6 @@ static const struct demod_module demod_modules[] = {
8987
.register_frontend = aml_dvb_register_frontend,
9088
.unregister_frontend = aml_dvb_unregister_frontend
9189
},
92-
#ifdef DEMOD_UNUSED
9390
{
9491
.name = "ite9173",
9592
.id = AM_DTV_DEMOD_ITE9173,
@@ -162,7 +159,6 @@ static const struct demod_module demod_modules[] = {
162159
.register_frontend = aml_dvb_register_frontend,
163160
.unregister_frontend = aml_dvb_unregister_frontend
164161
},
165-
#endif //DEMOD_UNUSED
166162
{
167163
.name = "atbm8881",
168164
.id = AM_DTV_DEMOD_ATBM8881,
@@ -247,7 +243,6 @@ static const struct demod_module demod_modules[] = {
247243
.register_frontend = aml_dvb_register_frontend,
248244
.unregister_frontend = aml_dvb_unregister_frontend
249245
},
250-
#ifdef DEMOD_UNUSED
251246
{
252247
.name = "mxl212c",
253248
.id = AM_DTV_DEMOD_MXL212C,
@@ -320,7 +315,6 @@ static const struct demod_module demod_modules[] = {
320315
.register_frontend = aml_dvb_register_frontend,
321316
.unregister_frontend = aml_dvb_unregister_frontend
322317
},
323-
#endif //DEMOD_UNUSED
324318
{
325319
.name = "mxl258c", //compatible with mxl212c/213c/214c/252c/254c/256c.
326320
.id = AM_DTV_DEMOD_MXL258C,

drivers/dvb/aml_tuner.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ static int aml_tuner_match(const struct tuner_module *module, int std);
1313
static int aml_tuner_detect(const struct tuner_config *cfg);
1414

1515
static const struct tuner_module tuner_modules[] = {
16-
#ifdef TUNER_UNUSED
1716
{
1817
.name = "si2176",
1918
.id = AM_TUNER_SI2176,
@@ -98,7 +97,6 @@ static const struct tuner_module tuner_modules[] = {
9897
.match = aml_tuner_match,
9998
.detect = aml_tuner_detect
10099
},
101-
#endif //TUNER_UNUSED
102100
{
103101
.name = "r840",
104102
.id = AM_TUNER_R840,
@@ -116,7 +114,6 @@ static const struct tuner_module tuner_modules[] = {
116114
.match = aml_tuner_match,
117115
.detect = aml_tuner_detect
118116
},
119-
#ifdef TUNER_UNUSED
120117
{
121118
.name = "si2157",
122119
.id = AM_TUNER_SI2157,
@@ -134,7 +131,6 @@ static const struct tuner_module tuner_modules[] = {
134131
.match = aml_tuner_match,
135132
.detect = aml_tuner_detect
136133
},
137-
#endif //TUNER_UNUSED
138134
{
139135
.name = "si2151",
140136
.id = AM_TUNER_SI2151,

drivers/dvb/demux/aml_dvb.c

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,16 @@ static int force_tsn_source;
7070

7171
int is_security_dmx;
7272

73-
static void demux_config_pipeline(int cfg_demod_tsn, int cfg_tsn_out)
73+
static void demux_config_pipeline(int cfg_demod_tsn, int cfg_tsn_out, int tee_compat)
7474
{
7575
u32 value = 0;
7676
int ret = 0;
7777

78+
if (tee_compat) {
79+
tee_demux_config_pipeline(cfg_demod_tsn, cfg_tsn_out);
80+
return;
81+
}
82+
7883
value = cfg_demod_tsn;
7984
value += cfg_tsn_out << 1;
8085

@@ -332,7 +337,7 @@ ssize_t tsn_source_store(struct class *class,
332337
// pr_dbg("tsn_in:%d, tsn_out:%d\n", tsn_in_reg, tsn_out);
333338
advb->dsc_pipeline = tsn_in_reg;
334339
//set demod/local
335-
demux_config_pipeline(tsn_in_reg, tsn_out);
340+
demux_config_pipeline(tsn_in_reg, tsn_out, advb->tee_compat);
336341

337342
mutex_unlock(&advb->mutex);
338343
return count;
@@ -341,6 +346,7 @@ ssize_t tsn_source_store(struct class *class,
341346
int tsn_set_double_out(int flag)
342347
{
343348
int tsn_in_reg = 0;
349+
struct aml_dvb *advb = aml_get_dvb_device();
344350

345351
if (tsn_out == flag)
346352
return 0;
@@ -350,7 +356,7 @@ int tsn_set_double_out(int flag)
350356
if (tsn_in == INPUT_DEMOD)
351357
tsn_in_reg = 1;
352358

353-
demux_config_pipeline(tsn_in_reg, tsn_out);
359+
demux_config_pipeline(tsn_in_reg, tsn_out, advb->tee_compat);
354360
return 0;
355361
}
356362

@@ -369,7 +375,7 @@ int tsn_source_force_set(int source)
369375
tsn_in = source;
370376
advb->dsc_pipeline = tsn_in_reg;
371377

372-
demux_config_pipeline(tsn_in_reg, 0);
378+
demux_config_pipeline(tsn_in_reg, 0, advb->tee_compat);
373379
force_tsn_source = 1;
374380
return 0;
375381
}
@@ -678,6 +684,21 @@ int dmx_get_tsn_flag(struct platform_device *pdev, int *tsn_in, int *tsn_out)
678684
return 0;
679685
}
680686

687+
u32 dmx_get_tee_compat_flag(struct platform_device *pdev)
688+
{
689+
char buf[32];
690+
u32 tee_compat = 0;
691+
int ret = 0;
692+
693+
memset(buf, 0, sizeof(buf));
694+
snprintf(buf, sizeof(buf), "tee_compat");
695+
ret = of_property_read_u32(pdev->dev.of_node, buf, &tee_compat);
696+
if (!ret)
697+
dprint_i("%s:%d\n", buf, tee_compat);
698+
699+
return tee_compat;
700+
}
701+
681702
struct aml_dvb *aml_get_dvb_device(void)
682703
{
683704
return &aml_dvb_device;
@@ -843,8 +864,9 @@ static int aml_dvb_probe(struct platform_device *pdev)
843864

844865
pr_dbg("tsn_in:%d, tsn_out:%d\n", tsn_in_reg, tsn_out);
845866
advb->dsc_pipeline = tsn_in_reg;
867+
advb->tee_compat = dmx_get_tee_compat_flag(pdev);
846868
//set demod/local
847-
demux_config_pipeline(tsn_in_reg, tsn_out);
869+
demux_config_pipeline(tsn_in_reg, tsn_out, advb->tee_compat);
848870

849871
dmx_init_hw();
850872

drivers/dvb/demux/aml_dvb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ struct aml_dvb {
6161
unsigned int tsn_flag;
6262
unsigned char loop_tsn;
6363
unsigned char ts_clone;
64+
unsigned char tee_compat;
6465
};
6566

6667
struct aml_dvb *aml_get_dvb_device(void);

drivers/input/ir/meson_ir_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ static int meson_ir_probe(struct platform_device *pdev)
948948

949949
device_init_wakeup(&pdev->dev, true);
950950

951-
led_trigger_register_simple("ir_led", &dev->led_feedback);
951+
led_trigger_register_simple("rc-feedback", &dev->led_feedback);
952952

953953
if (MULTI_IR_SOFTWARE_DECODE(dev->rc_type))
954954
meson_ir_raw_event_register(dev);

0 commit comments

Comments
 (0)