lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6b59155f-96d7-4d14-b08e-1ca1fa3c45ab@linaro.org>
Date:   Sat, 7 Oct 2023 17:36:54 +0200
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To:     Mehdi Djait <mehdi.djait@...tlin.com>, mchehab@...nel.org,
        heiko@...ech.de, hverkuil-cisco@...all.nl,
        laurent.pinchart@...asonboard.com,
        krzysztof.kozlowski+dt@...aro.org, robh+dt@...nel.org,
        conor+dt@...nel.org
Cc:     linux-media@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, thomas.petazzoni@...tlin.com,
        alexandre.belloni@...tlin.com, maxime.chevallier@...tlin.com,
        paul.kocialkowski@...tlin.com
Subject: Re: [PATCH v6 3/3] media: i2c: Introduce a driver for the Techwell
 TW9900 decoder

On 06/10/2023 18:25, Mehdi Djait wrote:
> The Techwell video decoder supports PAL, NTSC input formats,
> and outputs a BT.656 signal.
> 
> This commit adds support for this device, with basic support for NTSC
> and PAL, along with brightness and contrast controls.
> 
> The TW9900 is capable of doing automatic standard detection, this is
> implemented with support for PAL and NTSC autodetection.
> 
> Signed-off-by: Mehdi Djait <mehdi.djait@...tlin.com>

...

> +
> +static int tw9900_check_id(struct tw9900 *tw9900,
> +			   struct i2c_client *client)
> +{
> +	struct device *dev = &tw9900->client->dev;
> +	int ret;
> +
> +	ret = tw9900_read_reg(client, TW9900_CHIP_ID);
> +	if (ret < 0)
> +		return ret;
> +
> +	if (ret != TW9900_CHIP_ID) {
> +		dev_err(dev, "Unexpected decoder id(0x%x)\n", ret);
> +		return -EINVAL;
> +	}
> +
> +	dev_info(dev, "Detected TW9900 (0x%x) decoder\n", TW9900_CHIP_ID);

dev_dbg
Do not spam log with simple success messages.

Why do you always print 0x0 (TW9900_CHIP_ID) here? It does not make
sense, drop.


> +
> +	return 0;
> +}
> +
> +static int tw9900_probe(struct i2c_client *client)
> +{
> +	struct device *dev = &client->dev;
> +	struct v4l2_ctrl_handler *hdl;
> +	struct tw9900 *tw9900;
> +	int ret = 0;
> +
> +	tw9900 = devm_kzalloc(dev, sizeof(*tw9900), GFP_KERNEL);
> +	if (!tw9900)
> +		return -ENOMEM;
> +
> +	tw9900->client = client;
> +	tw9900->cur_mode = &supported_modes[0];
> +
> +	tw9900->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> +	if (IS_ERR(tw9900->reset_gpio))
> +		tw9900->reset_gpio = NULL;
> +
> +	tw9900->regulator = devm_regulator_get(&tw9900->client->dev, "vdd");
> +	if (IS_ERR(tw9900->regulator)) {
> +		dev_err(dev, "Failed to get power regulator\n");

return dev_err_probe()


Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ