Release 4.16 drivers/media/common/siano/smsir.c
// SPDX-License-Identifier: GPL-2.0+
//
// Siano Mobile Silicon, Inc.
// MDTV receiver kernel modules.
// Copyright (C) 2006-2009, Uri Shkolnik
//
// Copyright (c) 2010 - Mauro Carvalho Chehab
// - Ported the driver to use rc-core
// - IR raw event decoding is now done at rc-core
// - Code almost re-written
#include "smscoreapi.h"
#include <linux/types.h>
#include <linux/input.h>
#include "smsir.h"
#include "sms-cards.h"
#define MODULE_NAME "smsmdtv"
void sms_ir_event(struct smscore_device_t *coredev, const char *buf, int len)
{
int i;
const s32 *samples = (const void *)buf;
for (i = 0; i < len >> 2; i++) {
DEFINE_IR_RAW_EVENT(ev);
ev.duration = abs(samples[i]) * 1000; /* Convert to ns */
ev.pulse = (samples[i] > 0) ? false : true;
ir_raw_event_store(coredev->ir.dev, &ev);
}
ir_raw_event_handle(coredev->ir.dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mauro Carvalho Chehab | 55 | 50.93% | 1 | 25.00% |
Uri Shkolnik | 47 | 43.52% | 1 | 25.00% |
Maxim Levitsky | 4 | 3.70% | 1 | 25.00% |
David Härdeman | 2 | 1.85% | 1 | 25.00% |
Total | 108 | 100.00% | 4 | 100.00% |
int sms_ir_init(struct smscore_device_t *coredev)
{
int err;
int board_id = smscore_get_board_id(coredev);
struct rc_dev *dev;
pr_debug("Allocating rc device\n");
dev = rc_allocate_device(RC_DRIVER_IR_RAW);
if (!dev)
return -ENOMEM;
coredev->ir.controller = 0; /* Todo: vega/nova SPI number */
coredev->ir.timeout = IR_DEFAULT_TIMEOUT;
pr_debug("IR port %d, timeout %d ms\n",
coredev->ir.controller, coredev->ir.timeout);
snprintf(coredev->ir.name, sizeof(coredev->ir.name),
"SMS IR (%s)", sms_get_board(board_id)->name);
strlcpy(coredev->ir.phys, coredev->devpath, sizeof(coredev->ir.phys));
strlcat(coredev->ir.phys, "/ir0", sizeof(coredev->ir.phys));
dev->device_name = coredev->ir.name;
dev->input_phys = coredev->ir.phys;
dev->dev.parent = coredev->device;
#if 0
/* TODO: properly initialize the parameters below */
dev->input_id.bustype = BUS_USB;
dev->input_id.version = 1;
dev->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor);
dev->input_id.product = le16_to_cpu(dev->udev->descriptor.idProduct);
#endif
dev->priv = coredev;
dev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER;
dev->map_name = sms_get_board(board_id)->rc_codes;
dev->driver_name = MODULE_NAME;
pr_debug("Input device (IR) %s is set for key events\n",
dev->device_name);
err = rc_register_device(dev);
if (err < 0) {
pr_err("Failed to register device\n");
rc_free_device(dev);
return err;
}
coredev->ir.dev = dev;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Uri Shkolnik | 117 | 44.32% | 1 | 9.09% |
Mauro Carvalho Chehab | 86 | 32.58% | 5 | 45.45% |
David Härdeman | 55 | 20.83% | 2 | 18.18% |
Sean Young | 3 | 1.14% | 2 | 18.18% |
Andi Shyti | 3 | 1.14% | 1 | 9.09% |
Total | 264 | 100.00% | 11 | 100.00% |
void sms_ir_exit(struct smscore_device_t *coredev)
{
rc_unregister_device(coredev->ir.dev);
pr_debug("\n");
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Uri Shkolnik | 20 | 83.33% | 1 | 33.33% |
David Härdeman | 2 | 8.33% | 1 | 33.33% |
Mauro Carvalho Chehab | 2 | 8.33% | 1 | 33.33% |
Total | 24 | 100.00% | 3 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Uri Shkolnik | 198 | 46.59% | 1 | 7.14% |
Mauro Carvalho Chehab | 158 | 37.18% | 7 | 50.00% |
David Härdeman | 59 | 13.88% | 2 | 14.29% |
Maxim Levitsky | 4 | 0.94% | 1 | 7.14% |
Andi Shyti | 3 | 0.71% | 1 | 7.14% |
Sean Young | 3 | 0.71% | 2 | 14.29% |
Total | 425 | 100.00% | 14 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.