Re: [PATCH v2 1/3] ASoC: sma1307: Add driver for Iron Device SMA1307

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

 



On 03/09/2024 10:33, Ki-Seok Jo wrote:
>> On Tue, Sep 03, 2024 at 02:44:33PM +0900, Kiseok Jo wrote:
>>> Signed-off-by: Kiseok Jo <kiseok.jo@xxxxxxxxxxxxxx>
>>> ---
>>>  sound/soc/codecs/Kconfig   |    8 +
>>>  sound/soc/codecs/Makefile  |    2 +
>>>  sound/soc/codecs/sma1307.c | 2191
>>> ++++++++++++++++++++++++++++++++++++
>>>  sound/soc/codecs/sma1307.h |  454 ++++++++
>>>  4 files changed, 2655 insertions(+)
>>>  create mode 100644 sound/soc/codecs/sma1307.c  create mode 100644
>>> sound/soc/codecs/sma1307.h
>>>
>>
>> What are the differences against sm1303? Why it cannot be merged there?
>> You have entire commit msg to explain this instead of just sending empty
>> commit.
> 
> I will add a commit message in the next version of the patch.

and where is the changelog? Why do you send the same code as v2?

> 
> 
>>> +	unsigned int tsdw_cnt;
>>> +};
>>> +
>>> +static struct sma1307_pll_match sma1307_pll_matches[] = {
>>
>> const
> 
> Okay! 
> 
>>> +
>>> +/* DB scale conversion of speaker volume */ static const
>>> +DECLARE_TLV_DB_SCALE(sma1307_spk_tlv, -6000, 50, 0);
>>> +
>>> +static int sma1307_regmap_write(struct sma1307_priv *sma1307,
>>> +				unsigned int reg, unsigned int val) {
>>> +	int ret = 0;
>>> +	int cnt = sma1307->retry_cnt;
>>> +
>>> +	while (cnt--) {
>>
>> Sorry, but why? What is so broken in this hardware that it requires such
>> retries? Maybe just youro board is broken, not this codec?
>>
> 
> Generally, if there are no issues, retries shold not occur and it should execute only once.
> Could this be a problem?
> 
> I included the retries because there might be issues with the connection.

Write code in uniform style to the rest of the kernel. If there is a
problem, fix not only your but other users (BTW, might be already fixed
in regmap). Therefore if you do not see any other regmap I2C drivers
users doing this, that's a nice hint you are doing something maybe
unnecessary.

> 
> 
>>> +
>>> +static void sma1307_remove(struct snd_soc_component *component) {
>>> +	struct sma1307_priv *sma1307 =
>>> +snd_soc_component_get_drvdata(component);
>>> +
>>> +	cancel_delayed_work_sync(&sma1307->check_fault_work);
>>
>> Why do you cancel work in two different places?
> 
> 
> 
>>> +
>>> +	sma1307 = devm_kzalloc(&client->dev,
>>> +			       sizeof(struct sma1307_priv), GFP_KERNEL);
>>
>> sizeof(*)
>>
> 
> Sorry. What does it mean?


Adjust to existing kernel style. git grep kzalloc. It means use
dereference here.

> 
> 
>>> +
>>> +	ret = devm_snd_soc_register_component(&client->dev,
>>> +					      &sma1307_component, sma1307_dai,
>>> +					      1);
>>> +
>>
>> Drop blank line
> 
> Okay, When using 'Lindent', line breaks like this.
> I'll review and fix this.
> Thanks!
> 
> 
>>> +
>>> +static const struct i2c_device_id sma1307_i2c_id[] = {
>>> +	{ "sma1307", 0 },
>>> +	{ }
>>> +};
>>> +
>>> +MODULE_DEVICE_TABLE(i2c, sma1307_i2c_id);
>>> +
>>> +static const struct of_device_id sma1307_of_match[] = {
>>> +	{.compatible = "irondevice,sma1307a", },
>>> +	{.compatible = "irondevice,sma1307aq", },	//AEC-Q100 Qualificated
>>
>> Drop, useless. Also does not match your I2C ID table.
> 
> The SMA1307A and SMA1307AQ are different chips with different device settings.
> Therefore, when registering in the devicetree, I intended to register the specific product and
> Cofigure the device settings accordingly.

Then why match data is the same? If it is the same, then most likely it
is pointless. Otherwise why the differences are not visible in match
data or usage of compatible? If devices are compatible, make them so and
drop it.

> 
> I set the I2C ID table to just 'sma1307' as shown.
> So, should I change it to 'sma1307a' and 'sma1307aq instead?
> 
>> Anyway, bindings are before their users.

Here you have answer to your other question.



Best regards,
Krzysztof




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux