[linux-yocto] [PATCH 2/2] pwm: lpss: Prevent on_time_div overflow on lower frequencies
From: Mika Westerberg If duty_ns is large enough multiplying it by 255 overflows and results wrong duty cycle value being programmed. For example with 10ms duty when period is 20ms (50%) we get 255 * 1000 / 2000 = -87 because 255 * 1000 overlows int. Whereas correct value should be 255 * 1000 / 2000 = 127 Fix this by using unsigned long long as type for on_time_div and changing integer literals to use proper type annotation. Signed-off-by: Mika Westerberg --- drivers/pwm/pwm-lpss.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c index 98dc8b80b79d..be4658b42882 100644 --- a/drivers/pwm/pwm-lpss.c +++ b/drivers/pwm/pwm-lpss.c @@ -91,7 +91,7 @@ static int pwm_lpss_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) { struct pwm_lpss_chip *lpwm = to_lpwm(chip); - u8 on_time_div; + unsigned long long on_time_div; unsigned long c, base_unit_range; unsigned long long base_unit, freq = NSEC_PER_SEC; u32 ctrl; @@ -113,7 +113,9 @@ static int pwm_lpss_config(struct pwm_chip *chip, struct pwm_device *pwm, if (duty_ns <= 0) duty_ns = 1; - on_time_div = 255 - (255 * duty_ns / period_ns); + on_time_div = 255ULL * duty_ns; + do_div(on_time_div, period_ns); + on_time_div = 255ULL - on_time_div; pm_runtime_get_sync(chip->dev); -- 1.9.1 -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
[linux-yocto] [PATCH 1/2] pwm: lpss: fix base_unit calculation for PWM frequency
From: Dan O'Donovan The base_unit calculation applies an offset of 0x2 which adds significant error for lower frequencies and doesn't appear to be warranted - rounding the division result gives a correct value. Also, the upper limit check for base_unit is off-by-one; the upper nibble of base_unit is invalid if >=128 according to the Table 88 in the Z8000 Processor Series Datasheet Volume 1 (Rev. 2). Verified on UP Board (Cherry Trail) and Minnowboard Max (Bay Trail). Signed-off-by: Dan O'Donovan Acked-by: Mika Westerberg --- drivers/pwm/pwm-lpss.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c index 295b963dbddb..98dc8b80b79d 100644 --- a/drivers/pwm/pwm-lpss.c +++ b/drivers/pwm/pwm-lpss.c @@ -27,7 +27,6 @@ #define PWM_SW_UPDATE BIT(30) #define PWM_BASE_UNIT_SHIFT8 #define PWM_ON_TIME_DIV_MASK 0x00ff -#define PWM_DIVISION_CORRECTION0x2 /* Size of each PWM register space if multiple */ #define PWM_SIZE 0x400 @@ -101,17 +100,16 @@ static int pwm_lpss_config(struct pwm_chip *chip, struct pwm_device *pwm, /* * The equation is: -* base_unit = ((freq / c) * base_unit_range) + correction +* base_unit = round(base_unit_range * freq / c) */ base_unit_range = BIT(lpwm->info->base_unit_bits); - base_unit = freq * base_unit_range; + freq *= base_unit_range; c = lpwm->info->clk_rate; if (!c) return -EINVAL; - do_div(base_unit, c); - base_unit += PWM_DIVISION_CORRECTION; + base_unit = DIV_ROUND_CLOSEST_ULL(freq, c); if (duty_ns <= 0) duty_ns = 1; -- 1.9.1 -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
[linux-yocto] [PATCH 0/2] pwm backports
From: Eric Ernst Attached are a couple of patches which I pulled from Mika Westerberg's pwm-4.4 branch. These are required to correct pwm behavior on the Broxton GT platform Dan O'Donovan (1): pwm: lpss: fix base_unit calculation for PWM frequency Mika Westerberg (1): pwm: lpss: Prevent on_time_div overflow on lower frequencies drivers/pwm/pwm-lpss.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) -- 1.9.1 -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
[linux-yocto] [PULL REQUEST] MEI drivers updates to linux-yocto-4.4
Please pull the upstream mei driver changes for linux-yocto-4.4 This can merged ether standard/base or standard/intel/base The following changes since commit c49ed01a7e4c4fe9bfe4a4548480afd27d51088d: Merge branch 'standard/base' into standard/intel/base (2016-07-05 11:00:40 -0400) are available in the git repository at: https://github.com/tomasbw/linux-yocto-4.4.git standard/intel/base-mei for you to fetch changes up to d2de5bb3caeaca91022a01d2d86caaba7a15e21b: mei: don't use wake_up_interruptible for wr_ctrl (2016-07-07 13:40:16 +0300) Alexander Usyskin (30): mei: prevent queuing new flow control credit. mei: always copy the read buffer if data is ready mei: wd: drop the watchdog code from the core mei driver watchdog: mei_wdt: register wd device only if required watchdog: mei_wdt: re-register device on event mei: debugfs: adjust active clients print buffer mei: debugfs: allow hbm features list dump in earlier stages mei: call stop on failed char device register mei: amthif: don't copy from an empty buffer mei: amthif: don't drop read packets on timeout mei: amthif: allow only one request at a time mei: amthif: use rx_wait queue also for amthif client mei: amthif: interrupt reader on link reset mei: drop superfluous closing bracket from write traces mei: wake blocked write on link reset mei: clean write queues and wake waiters on disconnect mei: discard replies from unconnected fixed address clients mei: fill file pointer in read cb for fixed address client mei: fixed address clients for the new platforms mei: hbm: warn about fw-initiated disconnect mei: drop reserved host client ids mei: bus: run rescan on me_clients list change mei: hbm: send immediate reply flag in enum request mei: split amthif client init from end of clients enumeration mei: fix double freeing of a cb during link reset mei: fix format string in debug prints mei: drop global me_client_index mei: don't clean control queues on notify request timeout mei: fix waiting for wr_ctrl for corner cases. mei: don't use wake_up_interruptible for wr_ctrl Alexey Khoroshilov (1): mei: do not pin module if cldrv->probe() failed Rasmus Villemoes (1): mei: bus: use scnprintf in *_show Tomas Winkler (14): mei: bus: remove redundant uuid string in debug messages mei: drop nfc leftovers from the mei driver watchdog: mei_wdt: implement MEI iAMT watchdog driver watchdog: mei_wdt: add status debugfs entry mei: bus: whitelist the watchdog client mei: trace pci configuration space io mei: fix possible integer overflow issue mei: constify struct file pointer mei: rename variable names 'file_object' to fp mei: amthif: replace amthif_rd_complete_list with rd_completed mei: amthif: drop parameter validation from mei_amthif_write mei: bus: fix RX event scheduling mei: bus: fix notification event delivery mei: wd: drop AGAIN the watchdog code from the core mei driver Documentation/misc-devices/mei/mei.txt | 12 +- MAINTAINERS| 1 + drivers/misc/mei/Kconfig | 6 +- drivers/misc/mei/Makefile | 1 - drivers/misc/mei/amthif.c | 130 ++--- drivers/misc/mei/bus-fixup.c | 41 +- drivers/misc/mei/bus.c | 75 ++ drivers/misc/mei/client.c | 215 ++- drivers/misc/mei/client.h | 27 ++-- drivers/misc/mei/debugfs.c | 65 +++-- drivers/misc/mei/hbm.c | 47 +++--- drivers/misc/mei/hw-me.c | 10 +- drivers/misc/mei/hw-txe.c | 10 +- drivers/misc/mei/hw.h | 32 +++- drivers/misc/mei/init.c| 20 +-- drivers/misc/mei/interrupt.c | 94 +--- drivers/misc/mei/main.c| 106 ++ drivers/misc/mei/mei-trace.c | 2 + drivers/misc/mei/mei-trace.h | 40 - drivers/misc/mei/mei_dev.h | 120 +++ drivers/misc/mei/pci-me.c | 4 +- drivers/misc/mei/pci-txe.c | 4 +- drivers/misc/mei/wd.c | 391 - drivers/watchdog/Kconfig | 15 ++ drivers/watchdog/Makefile | 1 + drivers/watchdog/mei_wdt.c | 746 + 26 files changed, 1294 insertions(+), 921 deletions(-) delete mode 100644 drivers/misc/mei/wd.c create mode 100644 drivers/watchdog/mei_wdt.c -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.
[linux-yocto] [PATCH] usb: typec: wcove: add missing MODULE_ALIAS()
From: Felipe Balbi Upstream-Status: Pending This is an incremental patch for "usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY". Without a proper MODULE_ALIAS() driver won't get autoloaded. Let's add one. Reported-by: Pranav Tipnis Signed-off-by: Felipe Balbi --- drivers/usb/typec/typec_wcove.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/typec/typec_wcove.c b/drivers/usb/typec/typec_wcove.c index c7c2d28..0d9b58d 100644 --- a/drivers/usb/typec/typec_wcove.c +++ b/drivers/usb/typec/typec_wcove.c @@ -366,6 +366,7 @@ static struct platform_driver wcove_typec_driver = { module_platform_driver(wcove_typec_driver); +MODULE_ALIAS("platform:bxt_wcove_usbc"); MODULE_AUTHOR("Intel Corporation"); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("WhiskeyCove PMIC USB Type-C PHY driver"); -- 1.9.1 -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
[linux-yocto] [PATCH] Fix auto load of typec_wcove module
Intended for bxt-rebase branch to fix auto load of typec_wcove driver when built as loadable module. Felipe Balbi (1): usb: typec: wcove: add missing MODULE_ALIAS() drivers/usb/typec/typec_wcove.c | 1 + 1 file changed, 1 insertion(+) -- 1.9.1 -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
Re: [linux-yocto] [[yocto-kernel-cache][PATCH] mei.cfg: mei driver is no longer in staging
On 2016-07-07 07:48 AM, Tomas Winkler wrote: The mei driver was moved out of staging in kernel 3.15 merged. Bruce Signed-off-by: Tomas Winkler --- features/amt/mei/mei.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/features/amt/mei/mei.cfg b/features/amt/mei/mei.cfg index de6f6576871d..19aff024947a 100644 --- a/features/amt/mei/mei.cfg +++ b/features/amt/mei/mei.cfg @@ -1,4 +1,3 @@ -CONFIG_STAGING=y CONFIG_WATCHDOG_CORE=y CONFIG_INTEL_MEI=m CONFIG_INTEL_MEI_ME=m -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
Re: [linux-yocto] [PATCH 1/1][yocto-4.4] bsp/intel-common: add keyboard-gpio to intel-common-drivers
On 2016-07-06 08:42 PM, California Sullivan wrote: This feature is needed for power button functionality on some Broxton- based boards. merged. SRCREV updates to follow. Bruce Signed-off-by: California Sullivan --- bsp/intel-common/intel-common-drivers.scc | 1 + 1 file changed, 1 insertion(+) diff --git a/bsp/intel-common/intel-common-drivers.scc b/bsp/intel-common/intel-common-drivers.scc index 435992b..128c725 100644 --- a/bsp/intel-common/intel-common-drivers.scc +++ b/bsp/intel-common/intel-common-drivers.scc @@ -75,6 +75,7 @@ include features/spi/spidev.scc include cfg/dmaengine.scc include features/uio/uio.scc include cfg/efi-ext.scc +include features/input/keyboard-gpio.scc # default policy for standard kernels include cfg/usb-mass-storage.scc -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
Re: [linux-yocto] [yocto-kernel-cache] [PATCH] Thermal: Enable PMIC thermal configs
On 2016-07-06 07:14 PM, Nilesh Bacchewar wrote: Hello Bruce, This change enables PMIC thermal feature on broxton platform. Changes are added in coretemp.cfg and intel pmic. This change is targeted for yocto-4.4 branch. I had a minor conflict when merging this change, but it is now on the 4.4 and master branches. It is worth checking to make sure that I did get it merged correctly. Cheers, Bruce Nilesh Bacchewar (1): features/thermal: Enable Intel PMIC thermal feature features/power/intel_pmic.cfg | 6 ++ features/thermal/coretemp.cfg | 3 +++ 2 files changed, 9 insertions(+) -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
Re: [linux-yocto] [yocto-kernel-cache] [PATCH] Enable USB Type C for broxton
On 2016-07-06 06:48 PM, Pranav Tipnis wrote: Hello Bruce, This is to enable USB type C feature on broxton platform. I have created new config fragments for usb type c and intel pmic. This should go in yocto-4.4 branch. Merged. It is also now on master, so it will be available on the next kernel uprev as well. Bruce Pranav Tipnis (1): broxton: Enable USB Type C feature for broxton features/power/intel_pmic.cfg| 5 + features/power/intel_pmic.scc| 4 features/soc/broxton/broxton.cfg | 3 +++ features/soc/broxton/broxton.scc | 2 ++ features/usb/usb-typec.cfg | 2 ++ features/usb/usb-typec.scc | 4 6 files changed, 20 insertions(+) create mode 100644 features/power/intel_pmic.cfg create mode 100644 features/power/intel_pmic.scc create mode 100644 features/usb/usb-typec.cfg create mode 100644 features/usb/usb-typec.scc -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
Re: [linux-yocto] [PATCH] Update GPIO driver on linux-yocto-4.4 bxt-rebase branch
On 2016-07-06 06:12 PM, Nilesh Bacchewar wrote: This is incremental patchset to backported Intel WhiskeyCove GPIO driver on linux-yocto-4.4 from 4.7-rcX. This patch have been submitted upstream and the approval is in progress, hence may not be final. Patch have been rebased on bxt-rebase branch. merged. Bruce Nilesh Bacchewar (1): gpio: update Intel WhiskeyCove GPIO driver drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-wcove.c | 12 2 files changed, 5 insertions(+), 9 deletions(-) -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
[linux-yocto] [[yocto-kernel-cache][PATCH] mei.cfg: mei driver is no longer in staging
The mei driver was moved out of staging in kernel 3.15 Signed-off-by: Tomas Winkler --- features/amt/mei/mei.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/features/amt/mei/mei.cfg b/features/amt/mei/mei.cfg index de6f6576871d..19aff024947a 100644 --- a/features/amt/mei/mei.cfg +++ b/features/amt/mei/mei.cfg @@ -1,4 +1,3 @@ -CONFIG_STAGING=y CONFIG_WATCHDOG_CORE=y CONFIG_INTEL_MEI=m CONFIG_INTEL_MEI_ME=m -- 2.5.5 -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto