Re: [PATCH] platform/x86: Add Steam Deck driver

Hans de Goede
2022-02-17T16:35:19Z

Hi,

On 2/6/22 03:20, Andrey Smirnov wrote:
> Add a driver exposing various bits and pieces of functionality
> provided by Steam Deck specific VLV0100 device presented by EC
> firmware. This includes but not limited to:
>
> - CPU/device's fan control
> - Read-only access to DDIC registers
> - Battery tempreature measurements
> - Various display related control knobs
> - USB Type-C connector event notification
>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Mark Gross <markgross@kernel.org>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: linux-kernel@vger.kernel.org (open list)
> Cc: platform-driver-x86@vger.kernel.org
> Cc: linux-hwmon@vger.kernel.org
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>

The .c file says: "Copyright (C) 2021-2022 Valve Corporation", yet
you use a personal email address here. This is not really a problem,
but it does look a bit weird.

> ---
>
> This driver is really a kitchen sink of various small bits. Maybe it
> is worth splitting into an MFD + child drivers/devices?

With the extcon stuff thrown in the mix I think you definitely should
go for using MFD here.

Then you can submit a MFD driver under drivers/mfd for registering the
regmap + the cells + separate extcon + LED + backlight + hwmon drivers to
their resp. subsystems.

As drivers/platform/x86/ maintainer I would be happy to take a driver
for a "misc" cell for any remaining bits if there are any...

<snip>

> +struct steamdeck {
> + struct acpi_device *adev;
> + struct device *hwmon;
> + void *regmap;

That should be:

struct regmap *regmap;

> + long fan_target;
> + struct delayed_work role_work;
> + struct extcon_dev *edev;
> + struct device *dev;
> +};

Regards,

Hans