Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f7499fd authored by Andi Shyti's avatar Andi Shyti Committed by Mauro Carvalho Chehab
Browse files

[media] rc-main: assign driver type during allocation



The driver type can be assigned immediately when an RC device
requests to the framework to allocate the device.

This is an 'enum rc_driver_type' data type and specifies whether
the device is a raw receiver or scancode receiver. The type will
be given as parameter to the rc_allocate_device device.

Change accordingly all the drivers calling rc_allocate_device()
so that the device type is specified during the rc device
allocation. Whenever the device type is not specified, it will be
set as RC_DRIVER_SCANCODE which was the default '0' value.

Suggested-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarAndi Shyti <andi.shyti@samsung.com>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 97c12974
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -108,12 +108,11 @@ int picolcd_init_cir(struct picolcd_data *data, struct hid_report *report)
	struct rc_dev *rdev;
	int ret = 0;

	rdev = rc_allocate_device();
	rdev = rc_allocate_device(RC_DRIVER_IR_RAW);
	if (!rdev)
		return -ENOMEM;

	rdev->priv             = data;
	rdev->driver_type      = RC_DRIVER_IR_RAW;
	rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
	rdev->open             = picolcd_cir_open;
	rdev->close            = picolcd_cir_close;
+1 −2
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,

#if IS_REACHABLE(CONFIG_RC_CORE)
	/* Prepare the RC input device */
	adap->rc = rc_allocate_device();
	adap->rc = rc_allocate_device(RC_DRIVER_SCANCODE);
	if (!adap->rc) {
		pr_err("cec-%s: failed to allocate memory for rc_dev\n",
		       name);
@@ -259,7 +259,6 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
	adap->rc->input_id.vendor = 0;
	adap->rc->input_id.product = 0;
	adap->rc->input_id.version = 1;
	adap->rc->driver_type = RC_DRIVER_SCANCODE;
	adap->rc->driver_name = CEC_NAME;
	adap->rc->allowed_protocols = RC_BIT_CEC;
	adap->rc->priv = adap;
+1 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ int sms_ir_init(struct smscore_device_t *coredev)
	struct rc_dev *dev;

	pr_debug("Allocating rc device\n");
	dev = rc_allocate_device();
	dev = rc_allocate_device(RC_DRIVER_IR_RAW);
	if (!dev)
		return -ENOMEM;

@@ -86,7 +86,6 @@ int sms_ir_init(struct smscore_device_t *coredev)
#endif

	dev->priv = coredev;
	dev->driver_type = RC_DRIVER_IR_RAW;
	dev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
	dev->map_name = sms_get_board(board_id)->rc_codes;
	dev->driver_name = MODULE_NAME;
+1 −1
Original line number Diff line number Diff line
@@ -424,7 +424,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
		 * If platform_data doesn't specify rc_dev, initialize it
		 * internally
		 */
		rc = rc_allocate_device();
		rc = rc_allocate_device(RC_DRIVER_SCANCODE);
		if (!rc)
			return -ENOMEM;
	}
+1 −1
Original line number Diff line number Diff line
@@ -420,7 +420,7 @@ int bttv_input_init(struct bttv *btv)
		return -ENODEV;

	ir = kzalloc(sizeof(*ir),GFP_KERNEL);
	rc = rc_allocate_device();
	rc = rc_allocate_device(RC_DRIVER_SCANCODE);
	if (!ir || !rc)
		goto err_out_free;

Loading