All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "Sit, Michael Wei Hong" <michael.wei.hong.sit@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"Sia, Jee Heng" <jee.heng.sia@intel.com>
Subject: Re: [bug report] ASoC: Intel: KMB: Enable TDM audio capture
Date: Tue, 25 Aug 2020 10:58:23 -0500	[thread overview]
Message-ID: <5789a393-d2b7-4127-4875-2dbcb5a19bfc@linux.intel.com> (raw)
In-Reply-To: <2B5A2EFF-7391-4565-9B35-DCE395C7DD80@intel.com>


>>>>   506          switch (config->chan_nr) {
>>>>   507          case 8:
>>>>   508          case 4:
>>>>   509                  /*
>>>>   510                   * Platform is not capable of providing clocks for
>>>>   511                   * multi channel audio
>>>>   512                   */
>>>>   513                  if (kmb_i2s->master)
>>>>   514                          return -EINVAL;
>>>>   515
>>>>   516                  write_val = ((config->chan_nr / 2) << TDM_CHANNEL_CONFIG_BIT) |
>>>>   517                                  (config->data_width << DATA_WIDTH_CONFIG_BIT) |
>>>>   518                                  !MASTER_MODE | TDM_OPERATION;
>>>>                                        ^^^^^^^^^^^^
>>>> MASTER_MODE is BIT(13).  It's unclear what this is supposed to be.  My
>>>> best guess is that the ! should just be deleted.
>>>
>>> This ! is intentional because it is meant to be Slave mode. Would a better approach be to create another #define for slave mode?
>>
>> In my opinion, it's better to just leave it out.  ORing with zero causes
>> a different static checker warning on my unreleased checks...  Is it
>> 0 << 13?  I feel like ORing with zero just makes things more confusing.
>>
> It is 0<<13, in the event it was previously configured to Master I would need to unset the bit

You are assigning the result to write_val, so there's no memory of what 
was configured before?

  reply	other threads:[~2020-08-25 15:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 13:21 [bug report] ASoC: Intel: KMB: Enable TDM audio capture Dan Carpenter
2020-08-25 13:49 ` Sit, Michael Wei Hong
2020-08-25 13:58   ` Dan Carpenter
2020-08-25 14:47     ` Sit, Michael Wei Hong
2020-08-25 15:58       ` Pierre-Louis Bossart [this message]
2020-08-25 17:22         ` Sit, Michael Wei Hong
2020-08-25 18:23           ` Pierre-Louis Bossart
2020-08-26  3:09             ` Sit, Michael Wei Hong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5789a393-d2b7-4127-4875-2dbcb5a19bfc@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.carpenter@oracle.com \
    --cc=jee.heng.sia@intel.com \
    --cc=michael.wei.hong.sit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.