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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250225074214.29902-1-wangweidong.a@awinic.com>
Date: Tue, 25 Feb 2025 15:42:14 +0800
From: wangweidong.a@...nic.com
To: krzk@...nel.org
Cc: broonie@...nel.org,
	conor+dt@...nel.org,
	devicetree@...r.kernel.org,
	ivprusov@...utedevices.com,
	jack.yu@...ltek.com,
	krzk+dt@...nel.org,
	lgirdwood@...il.com,
	linux-kernel@...r.kernel.org,
	linux-sound@...r.kernel.org,
	nuno.sa@...log.com,
	paulha@...nsource.cirrus.com,
	perex@...ex.cz,
	quic_pkumpatl@...cinc.com,
	rf@...nsource.cirrus.com,
	robh@...nel.org,
	tiwai@...e.com,
	wangweidong.a@...nic.com,
	yijiangtao@...nic.com,
	zhoubinbin@...ngson.cn
Subject: Re: [PATCH V1 2/2] ASoC: codecs: Add aw88166 amplifier driver

Thank you very much for your review

On Fri, Feb 23, 2025 at 12:46:14 +0100, krzk@...nel.org wrote:
> On Fri, Feb 21, 2025 at 06:26:23PM +0800, wangweidong.a@...nic.com wrote:
>> +
>> +static void aw88166_hw_reset(struct aw88166 *aw88166)
>> +{
>> +	if (aw88166->reset_gpio) {
>> +		gpiod_set_value_cansleep(aw88166->reset_gpio, 1);
>> +		usleep_range(AW88166_1000_US, AW88166_1000_US + 10);
>> +		gpiod_set_value_cansleep(aw88166->reset_gpio, 0);
>> +		usleep_range(AW88166_1000_US, AW88166_1000_US + 10);
>> +		gpiod_set_value_cansleep(aw88166->reset_gpio, 1);

> Why do you keep reset as active after reset? How is it suppose to work?

The gpio port of the AW88166 is reset when it is low.
So it's working now, I will modify it as follows:
if (aw88166->reset_gpio) {
	gpiod_set_value_cansleep(aw88166->reset_gpio, 0);
	usleep_range(AW88166_1000_US, AW88166_1000_US + 10);
	gpiod_set_value_cansleep(aw88166->reset_gpio, 1);
	usleep_range(AW88166_1000_US, AW88166_1000_US + 10);
}

>> +static int aw88166_i2c_probe(struct i2c_client *i2c)
>> +{
>> +	struct aw88166 *aw88166;
>> +	int ret;
>> +
>> +	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C))
>> +		return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed\n");
>> +
>> +	aw88166 = devm_kzalloc(&i2c->dev, sizeof(*aw88166), GFP_KERNEL);
>> +	if (!aw88166)
>> +		return -ENOMEM;
>> +
>> +	mutex_init(&aw88166->lock);
>> +
>> +	i2c_set_clientdata(i2c, aw88166);
>> +
>> +	aw88166->reset_gpio = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_LOW);


> So here reset is low...


>> +	if (IS_ERR(aw88166->reset_gpio))
>> +		return dev_err_probe(&i2c->dev, PTR_ERR(aw88166->reset_gpio),
>> +							"reset gpio not defined\n");
>> +	aw88166_hw_reset(aw88166);

> and here is high afterwards?

Yes, low indicates reset state, high indicates working state

Best regards,
Weidong Wang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ