All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Gromm <christian.gromm@microchip.com>
To: gregkh@linuxfoundation.org
Cc: Christian Gromm <christian.gromm@microchip.com>,
	driverdev-devel@linuxdriverproject.org
Subject: [PATCH 11/28] staging: most: i2c: trace real polling rate
Date: Tue, 8 May 2018 11:44:59 +0200	[thread overview]
Message-ID: <1525772716-15742-12-git-send-email-christian.gromm@microchip.com> (raw)
In-Reply-To: <1525772716-15742-1-git-send-email-christian.gromm@microchip.com>

The real polling rate depends on the CONFIG_HZ and may differ from the
required polling rate.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
 drivers/staging/most/i2c/i2c.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/i2c/i2c.c b/drivers/staging/most/i2c/i2c.c
index 30d18cc..39b1590 100644
--- a/drivers/staging/most/i2c/i2c.c
+++ b/drivers/staging/most/i2c/i2c.c
@@ -76,7 +76,7 @@ static int configure_channel(struct most_interface *most_iface,
 {
 	int ret;
 	struct hdm_i2c *dev = to_hdm(most_iface);
-	unsigned int delay;
+	unsigned int delay, pr;
 
 	BUG_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);
 	BUG_ON(dev->is_open[ch_idx]);
@@ -109,7 +109,8 @@ static int configure_channel(struct most_interface *most_iface,
 		} else if (scan_rate) {
 			delay = msecs_to_jiffies(MSEC_PER_SEC / scan_rate);
 			dev->rx.delay = delay ? delay : 1;
-			pr_info("polling rate is %d Hz\n", scan_rate);
+			pr = MSEC_PER_SEC / jiffies_to_msecs(dev->rx.delay);
+			pr_info("polling rate is %u Hz\n", pr);
 		}
 	}
 	dev->is_open[ch_idx] = true;
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2018-05-08  9:46 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08  9:44 [PATCH 00/28] staging: most: fix issues Christian Gromm
2018-05-08  9:44 ` [PATCH 01/28] staging: most: allocate only all requested memory Christian Gromm
2018-05-09 13:19   ` Dan Carpenter
2018-05-09 14:09     ` Christian Gromm
2018-05-09 14:54       ` Dan Carpenter
2018-05-09 15:18         ` Christian Gromm
2018-05-09 15:29           ` Greg KH
2018-05-11  7:36             ` Christian Gromm
2018-05-08  9:44 ` [PATCH 02/28] staging: most: dim2: remove clock speed processing from the HDM Christian Gromm
2018-05-08  9:44 ` [PATCH 03/28] staging: most: i2c: prevent division by zero Christian Gromm
2018-05-08  9:44 ` [PATCH 04/28] staging: most: i2c: remove unnecessary poison_channel call Christian Gromm
2018-05-08  9:44 ` [PATCH 05/28] staging: most: add channel property dbr_size Christian Gromm
2018-05-08  9:44 ` [PATCH 06/28] staging: most: aim-sound: add flexible format support Christian Gromm
2018-05-08  9:44 ` [PATCH 07/28] staging: most: i2c: shorten lifetime of IRQ handler Christian Gromm
2018-05-08  9:44 ` [PATCH 08/28] staging: most: i2c: do not wait in work function Christian Gromm
2018-05-08  9:44 ` [PATCH 09/28] staging: most: i2c: avoid polling in case of misconfig Christian Gromm
2018-05-09 13:46   ` Dan Carpenter
2018-05-09 14:20     ` Christian Gromm
2018-05-08  9:44 ` [PATCH 10/28] staging: most: i2c: prevent zero delay polling Christian Gromm
2018-05-08  9:44 ` Christian Gromm [this message]
2018-05-08  9:45 ` [PATCH 12/28] staging: most: i2c: remove redundant is_open Christian Gromm
2018-05-08  9:45 ` [PATCH 13/28] staging: most: i2c: remove redundant list_mutex Christian Gromm
2018-05-08  9:45 ` [PATCH 14/28] staging: most: i2c: reduce parameters inconsistency Christian Gromm
2018-05-08  9:45 ` [PATCH 15/28] staging: most: make interface drivers allocate coherent memory Christian Gromm
2018-05-08  9:45 ` [PATCH 16/28] staging: most: sound: call snd_card_new with struct device Christian Gromm
2018-05-08  9:45 ` [PATCH 17/28] staging: most: cdev: avoid warning about potentially uninitialized variable Christian Gromm
2018-05-08  9:45 ` [PATCH 18/28] staging: most: cdev: fix chrdev_region leak Christian Gromm
2018-05-08  9:45 ` [PATCH 19/28] staging: most: usb: add ep number to log Christian Gromm
2018-05-08  9:45 ` [PATCH 20/28] staging: most: cdev: fix function return value Christian Gromm
2018-05-08  9:45 ` [PATCH 21/28] staging: most: dim2: fix startup sequence Christian Gromm
2018-05-08  9:45 ` [PATCH 22/28] staging: most: cdev: fix race condition Christian Gromm
2018-05-08  9:45 ` [PATCH 23/28] staging: most: dim2: use device tree Christian Gromm
2021-10-12 18:14   ` Geert Uytterhoeven
2021-10-13 12:24     ` Greg KH
2018-05-08  9:45 ` [PATCH 24/28] staging: most: dim2: read clock speed from the device Christian Gromm
2018-05-08  9:45 ` [PATCH 25/28] staging: most: dim2: use device to allocate coherent memory Christian Gromm
2018-05-08  9:45 ` [PATCH 26/28] staging: most: usb: don't set URB_ZERO_PACKET flag for synchronous data Christian Gromm
2018-05-08  9:45 ` [PATCH 27/28] staging: most: usb: fix usb_disconnect race condition Christian Gromm
2018-05-08  9:45 ` [PATCH 28/28] staging: most: usb: remove local variable Christian Gromm

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=1525772716-15742-12-git-send-email-christian.gromm@microchip.com \
    --to=christian.gromm@microchip.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    /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.