Re: [PATCH V1 2/2] ASoC: codecs: Add aw88166 amplifier driver

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

 



Thank you very much for your review

On Fri, Feb 23, 2025 at 12:46:14 +0100, krzk@xxxxxxxxxx wrote:
> On Fri, Feb 21, 2025 at 06:26:23PM +0800, wangweidong.a@xxxxxxxxxx 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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux