21 #define DSS_SUBSYS_NAME "MANAGER"
23 #include <linux/kernel.h>
24 #include <linux/slab.h>
25 #include <linux/module.h>
44 dssdev->
name :
"<none>");
48 const char *buf,
size_t size)
60 if (buf[size-1] ==
'\n')
66 if (len > 0 && dssdev ==
NULL)
75 DSSERR(
"failed to unset current output\n");
88 DSSERR(
"device has no output connected to it\n");
94 DSSERR(
"failed to set manager output\n");
100 DSSERR(
"failed to apply dispc config\n");
123 const char *buf,
size_t size)
148 static const char *trans_key_type_str[] = {
161 key_type =
info.trans_key_type;
168 const char *buf,
size_t size)
175 key_type <
ARRAY_SIZE(trans_key_type_str); key_type++) {
176 if (
sysfs_streq(buf, trans_key_type_str[key_type]))
180 if (key_type ==
ARRAY_SIZE(trans_key_type_str))
185 info.trans_key_type = key_type;
209 const char *buf,
size_t size)
221 info.trans_key = key_value;
245 const char *buf,
size_t size)
270 static ssize_t manager_alpha_blending_enabled_show(
280 info.partial_alpha_enabled);
283 static ssize_t manager_alpha_blending_enabled_store(
285 const char *buf,
size_t size)
323 const char *buf,
size_t size)
338 if (
info.cpr_enable == enable)
362 "%d %d %d %d %d %d %d %d %d\n",
375 const char *buf,
size_t size)
385 if (
sscanf(buf,
"%hd %hd %hd %hd %hd %hd %hd %hd %hd",
386 &coefs.rr, &coefs.rg, &coefs.rb,
387 &coefs.gr, &coefs.gg, &coefs.gb,
388 &coefs.br, &coefs.bg, &coefs.bb) != 9)
391 arr = (
s16[]){ coefs.rr, coefs.rg, coefs.rb,
392 coefs.gr, coefs.gg, coefs.gb,
393 coefs.br, coefs.bg, coefs.bb };
395 for (i = 0; i < 9; ++
i) {
396 if (arr[i] < -512 || arr[i] > 511)
402 info.cpr_coefs = coefs;
421 #define MANAGER_ATTR(_name, _mode, _show, _store) \
422 struct manager_attribute manager_attr_##_name = \
423 __ATTR(_name, _mode, _show, _store)
427 manager_display_show, manager_display_store);
429 manager_default_color_show, manager_default_color_store);
431 manager_trans_key_type_show, manager_trans_key_type_store);
433 manager_trans_key_value_show, manager_trans_key_value_store);
435 manager_trans_key_enabled_show,
436 manager_trans_key_enabled_store);
438 manager_alpha_blending_enabled_show,
439 manager_alpha_blending_enabled_store);
441 manager_cpr_enable_show,
442 manager_cpr_enable_store);
444 manager_cpr_coef_show,
445 manager_cpr_coef_store);
448 static struct attribute *manager_sysfs_attrs[] = {
449 &manager_attr_name.attr,
450 &manager_attr_display.attr,
451 &manager_attr_default_color.attr,
452 &manager_attr_trans_key_type.attr,
453 &manager_attr_trans_key_value.attr,
454 &manager_attr_trans_key_enabled.attr,
455 &manager_attr_alpha_blending_enabled.attr,
456 &manager_attr_cpr_enable.attr,
457 &manager_attr_cpr_coef.attr,
470 if (!manager_attr->
show)
473 return manager_attr->
show(manager, buf);
477 const char *buf,
size_t size)
485 if (!manager_attr->
store)
488 return manager_attr->
store(manager, buf, size);
491 static const struct sysfs_ops manager_sysfs_ops = {
492 .show = manager_attr_show,
493 .store = manager_attr_store,
496 static struct kobj_type manager_ktype = {
497 .sysfs_ops = &manager_sysfs_ops,
498 .default_attrs = manager_sysfs_attrs,
505 &pdev->
dev.kobj,
"manager%d", mgr->
id);