Commit aef01aad authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

Input: matrix-keypad - switch to using generic device properties



Instead of being OF-specific, let's switch to using generic device
properties, which will make this code usable on ACPI, device tree and
legacy boards that use property sets.

As part of the change let's rename matrix_keypad_parse_of_params() to
matrix_keypad_parse_properties().

Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent b1fe0cf0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ static int bcm_kp_matrix_key_parse_dt(struct bcm_kp *kp)
	/* Initialize the KPCR Keypad Configuration Register */
	kp->kpcr = KPCR_STATUSFILTERENABLE | KPCR_COLFILTERENABLE;

	error = matrix_keypad_parse_of_params(dev, &kp->n_rows, &kp->n_cols);
	error = matrix_keypad_parse_properties(dev, &kp->n_rows, &kp->n_cols);
	if (error) {
		dev_err(dev, "failed to parse kp params\n");
		return error;
+2 −1
Original line number Diff line number Diff line
@@ -229,7 +229,8 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
	ckdev = devm_kzalloc(dev, sizeof(*ckdev), GFP_KERNEL);
	if (!ckdev)
		return -ENOMEM;
	err = matrix_keypad_parse_of_params(dev, &ckdev->rows, &ckdev->cols);

	err = matrix_keypad_parse_properties(dev, &ckdev->rows, &ckdev->cols);
	if (err)
		return err;

+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ static int lpc32xx_parse_dt(struct device *dev,
	u32 rows = 0, columns = 0;
	int err;

	err = matrix_keypad_parse_of_params(dev, &rows, &columns);
	err = matrix_keypad_parse_properties(dev, &rows, &columns);
	if (err)
		return err;
	if (rows != columns) {
+2 −2
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ static int omap4_keypad_parse_dt(struct device *dev,
	struct device_node *np = dev->of_node;
	int err;

	err = matrix_keypad_parse_of_params(dev, &keypad_data->rows,
	err = matrix_keypad_parse_properties(dev, &keypad_data->rows,
					     &keypad_data->cols);
	if (err)
		return err;
+1 −1
Original line number Diff line number Diff line
@@ -515,7 +515,7 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
	int rc;
	unsigned int ctrl_val;

	rc = matrix_keypad_parse_of_params(&pdev->dev, &rows, &cols);
	rc = matrix_keypad_parse_properties(&pdev->dev, &rows, &cols);
	if (rc)
		return rc;

Loading