Re: [PATCH V7 3/3] leds: Add support for UP board CPLD onboard LEDS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31/10/2023 02:51, larry.lai wrote:
> The UP boards come with a few FPGA-controlled onboard LEDs:
> * UP Board: yellow, green, red
> * UP Squared: blue, yellow, green, red
> 
> This patch depends on patch "mfd: Add support for UP board CPLD/FPGA".

Your commit msg should not describe dependencies within patches. Cover
letter or --- changelog should. This is totally irrelevant for the git
history.

> 
> Signed-off-by: Gary Wang <garywang@xxxxxxxxxxxx>
> Signed-off-by: larry.lai <larry.lai@xxxxxxxxxxxxxxx>

...

> +
> +static int __init upboard_led_probe(struct platform_device *pdev)

Same problems.

> +{
> +	struct upboard_fpga * const cpld = dev_get_drvdata(pdev->dev.parent);
> +	struct reg_field fldconf = {
> +		.reg = UPFPGA_REG_FUNC_EN0,
> +	};
> +	struct upboard_led_data * const pdata = pdev->dev.platform_data;
> +	struct upboard_led *led;
> +
> +	/* check & register GPIO LEDs */
> +	if (strstr(pdata->colour, "gpio"))
> +		return upboard_led_gpio_register(cpld);
> +
> +	led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);
> +	if (!led)
> +		return -ENOMEM;
> +
> +	fldconf.lsb = pdata->bit;
> +	fldconf.msb = pdata->bit;
> +	led->field = devm_regmap_field_alloc(&pdev->dev, cpld->regmap, fldconf);
> +	if (IS_ERR(led->field))
> +		return PTR_ERR(led->field);
> +
> +	led->cdev.brightness_get = upboard_led_brightness_get;
> +	led->cdev.brightness_set = upboard_led_brightness_set;
> +	led->cdev.name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "upboard:%s:", pdata->colour);
> +	if (!led->cdev.name)
> +		return -ENOMEM;
> +
> +	return devm_led_classdev_register(&pdev->dev, &led->cdev);
> +};
> +
> +static struct platform_driver upboard_led_driver = {
> +	.driver = {
> +		.name = "upboard-led",
> +	},
> +};
> +module_platform_driver_probe(upboard_led_driver, upboard_led_probe);
> +
> +MODULE_AUTHOR("Gary Wang <garywang@xxxxxxxxxxxx>");
> +MODULE_DESCRIPTION("UP Board LED driver");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:upboard-led");

Same problem.

Best regards,
Krzysztof




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux