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

Commit e590d66d authored by Swetha Chikkaboraiah's avatar Swetha Chikkaboraiah Committed by Chetan C R
Browse files

input: gpio-matrix-keypad: Accept device name from device node



The device name is not properly set if the platform device
is created from device tree.  Read "input-name" property to
set the device name.

Change-Id: Ib348df17f2222d88032435424cfcff9d37054ddd
Signed-off-by: default avatarSwetha Chikkaboraiah <schikk@codeaurora.org>
Signed-off-by: default avatarChetan C R <cchinnad@codeaurora.org>
parent e875cf55
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -446,6 +446,8 @@ matrix_keypad_parse_dt(struct device *dev)
	if (of_get_property(np, "gpio-activelow", NULL))
		pdata->active_low = true;

	pdata->name = of_get_property(np, "input-name", NULL);

	of_property_read_u32(np, "debounce-delay-ms", &pdata->debounce_ms);
	of_property_read_u32(np, "col-scan-delay-us",
						&pdata->col_scan_delay_us);
@@ -511,7 +513,6 @@ static int matrix_keypad_probe(struct platform_device *pdev)
		err = -ENOMEM;
		goto err_free_mem;
	}

	keypad->input_dev = input_dev;
	keypad->pdata = pdata;
	keypad->row_shift = get_count_order(pdata->num_col_gpios);
@@ -519,7 +520,7 @@ static int matrix_keypad_probe(struct platform_device *pdev)
	INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan);
	spin_lock_init(&keypad->lock);

	input_dev->name		= pdev->name;
	input_dev->name		= pdata->name ? : pdev->name;
	input_dev->id.bustype	= BUS_HOST;
	input_dev->dev.parent	= &pdev->dev;
	input_dev->open		= matrix_keypad_start;
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ struct matrix_keypad_platform_data {
	bool		active_low;
	bool		wakeup;
	bool		no_autorepeat;
	const char	*name; /* input device name */
};

int matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data,