From: Jacob Bai <jacob.bai.au@gmail.com>
To: Deepak R Varma <drv@mailo.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
error27@gmail.com
Subject: Re: [PATCH] staging: pi433: change (struct pi433_tx_cfg)->bit_rate to be a u32
Date: Tue, 14 Feb 2023 20:24:36 +1100 [thread overview]
Message-ID: <Y+tTVKWqiIZnySUz@jacob-Ubuntu> (raw)
In-Reply-To: <Y+s/HP+v7lx2SKRj@ubun2204.myguest.virtualbox.org>
On Tue, Feb 14, 2023 at 01:28:20PM +0530, Deepak R Varma wrote:
> On Tue, Feb 14, 2023 at 05:33:46PM +1100, Jacob Bai wrote:
> > Based on the TODO file and datasheet of pi433, the maximum bit rate for
> > transmitter is 300kbps when modulation been set to FSK. Hence, the size
> > should be u32 rather than u16.
>
> Hi Jacob,
> This change was already discussed recently. Please check the following link and
> all the responses to this thread:
>
> https://lore.kernel.org/all/Y9h42l%2F8EcPqn63x@combine-ThinkPad-S1-Yoga/
>
> Thanks,
> ./drv
Thanks Deepak and Dan!
Regards,
Jacob
>
> >
> > Signed-off-by: Jacob Bai <jacob.bai.au@gmail.com>
> > ---
> > drivers/staging/pi433/Documentation/pi433.txt | 3 ++-
> > drivers/staging/pi433/pi433_if.h | 2 +-
> > drivers/staging/pi433/rf69.c | 4 ++--
> > drivers/staging/pi433/rf69.h | 2 +-
> > 4 files changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/staging/pi433/Documentation/pi433.txt b/drivers/staging/pi433/Documentation/pi433.txt
> > index 4a0d34b4ad37..b34d8e9f6d53 100644
> > --- a/drivers/staging/pi433/Documentation/pi433.txt
> > +++ b/drivers/staging/pi433/Documentation/pi433.txt
> > @@ -78,7 +78,8 @@ rf params:
> > Allowed values: 433050000...434790000
> > bit_rate
> > bit rate used for transmission.
> > - Allowed values: #####
> > + Allowed values when FSK: 1200...300000
> > + Allowed values when OOK: 1200...32768
> > dev_frequency
> > frequency deviation in case of FSK.
> > Allowed values: 600...500000
> > diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h
> > index 25ee0b77a32c..1f8ffaf02d99 100644
> > --- a/drivers/staging/pi433/pi433_if.h
> > +++ b/drivers/staging/pi433/pi433_if.h
> > @@ -51,7 +51,7 @@ enum option_on_off {
> > #define PI433_TX_CFG_IOCTL_NR 0
> > struct pi433_tx_cfg {
> > __u32 frequency;
> > - __u16 bit_rate;
> > + __u32 bit_rate;
> > __u32 dev_frequency;
> > enum modulation modulation;
> > enum mod_shaping mod_shaping;
> > diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
> > index 8c7fab6a46bb..0b90ca004dd6 100644
> > --- a/drivers/staging/pi433/rf69.c
> > +++ b/drivers/staging/pi433/rf69.c
> > @@ -185,7 +185,7 @@ int rf69_set_modulation_shaping(struct spi_device *spi,
> > }
> > }
> >
> > -int rf69_set_bit_rate(struct spi_device *spi, u16 bit_rate)
> > +int rf69_set_bit_rate(struct spi_device *spi, u32 bit_rate)
> > {
> > int retval;
> > u32 bit_rate_reg;
> > @@ -201,7 +201,7 @@ int rf69_set_bit_rate(struct spi_device *spi, u16 bit_rate)
> > }
> >
> > // check input value
> > - if (bit_rate < 1200 || (mod == OOK && bit_rate > 32768)) {
> > + if (bit_rate < 1200 || bit_rate > 300000 || (mod == OOK && bit_rate > 32768)) {
> > dev_dbg(&spi->dev, "setBitRate: illegal input param\n");
> > return -EINVAL;
> > }
> > diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
> > index 78fa0b8bab8b..46a1fb2d5329 100644
> > --- a/drivers/staging/pi433/rf69.h
> > +++ b/drivers/staging/pi433/rf69.h
> > @@ -24,7 +24,7 @@ int rf69_set_data_mode(struct spi_device *spi, u8 data_mode);
> > int rf69_set_modulation(struct spi_device *spi, enum modulation modulation);
> > int rf69_set_modulation_shaping(struct spi_device *spi,
> > enum mod_shaping mod_shaping);
> > -int rf69_set_bit_rate(struct spi_device *spi, u16 bit_rate);
> > +int rf69_set_bit_rate(struct spi_device *spi, u32 bit_rate);
> > int rf69_set_deviation(struct spi_device *spi, u32 deviation);
> > int rf69_set_frequency(struct spi_device *spi, u32 frequency);
> > int rf69_enable_amplifier(struct spi_device *spi, u8 amplifier_mask);
> > --
> > 2.34.1
> >
> >
>
>
prev parent reply other threads:[~2023-02-14 9:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 6:33 [PATCH] staging: pi433: change (struct pi433_tx_cfg)->bit_rate to be a u32 Jacob Bai
2023-02-14 8:25 ` Dan Carpenter
[not found] ` <Y+s/HP+v7lx2SKRj@ubun2204.myguest.virtualbox.org>
2023-02-14 9:24 ` Jacob Bai [this message]
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=Y+tTVKWqiIZnySUz@jacob-Ubuntu \
--to=jacob.bai.au@gmail.com \
--cc=drv@mailo.com \
--cc=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox