mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Merge 5.4.261 into android11-5.4-lts
Changes in 5.4.261 vfs: fix readahead(2) on block devices genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() i40e: fix potential memory leaks in i40e_remove() tcp: call tcp_try_undo_recovery when an RTOd TFO SYNACK is ACKed wifi: rtw88: debug: Fix the NULL vs IS_ERR() bug for debugfs_create_file() wifi: mt76: mt7603: rework/fix rx pse hang check tcp_metrics: add missing barriers on delete tcp_metrics: properly set tp->snd_ssthresh in tcp_init_metrics() tcp_metrics: do not create an entry from tcp_init_metrics() wifi: rtlwifi: fix EDCA limit set by BT coexistence can: dev: can_restart(): don't crash kernel if carrier is OK can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() thermal: core: prevent potential string overflow r8169: use tp_to_dev instead of open code r8169: fix rare issue with broken rx after link-down on RTL8125 chtls: fix tp->rcv_tstamp initialization tcp: Remove one extra ktime_get_ns() from cookie_init_timestamp tcp: fix cookie_init_timestamp() overflows ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() ipv6: avoid atomic fragment on GSO packets net: add DEV_STATS_READ() helper ipvlan: properly track tx_errors regmap: debugfs: Fix a erroneous check after snprintf() clk: qcom: clk-rcg2: Fix clock rate overflow for high parent frequencies clk: qcom: gcc-sm8150: use ARRAY_SIZE instead of specifying num_parents clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src clk: imx: Select MXC_CLK for CLK_IMX8QXP clk: keystone: pll: fix a couple NULL vs IS_ERR() checks clk: npcm7xx: Fix incorrect kfree clk: mediatek: clk-mt6779: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt6797: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt7629-eth: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt7629: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data platform/x86: wmi: Fix probe failure when failing to register WMI devices platform/x86: wmi: remove unnecessary initializations platform/x86: wmi: Fix opening of char device hwmon: (coretemp) Fix potentially truncated sysfs attribute name drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs drm/rockchip: vop: Fix call to crtc reset helper drm/radeon: possible buffer overflow drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() arm64: dts: qcom: sdm845-mtp: fix WiFi configuration ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator soc: qcom: llcc cleanup to get rid of sdm845 specific driver file soc: qcom: Rename llcc-slice to llcc-qcom soc: qcom: llcc: Handle a second device without data corruption firmware: ti_sci: Replace HTTP links with HTTPS ones firmware: ti_sci: Mark driver as non removable clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped hwrng: geode - fix accessing registers libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value sched/rt: Provide migrate_disable/enable() inlines nd_btt: Make BTT lanes preemptible crypto: caam/qi2 - fix Chacha20 + Poly1305 self test failure crypto: caam/jr - fix Chacha20 + Poly1305 self test failure HID: cp2112: Use irqchip template hid: cp2112: Fix duplicate workqueue initialization ARM: 9321/1: memset: cast the constant byte to unsigned char ext4: move 'ix' sanity check to corrent position scsi: ufs: core: Leave space for '\0' in utf8 desc string RDMA/hfi1: Workaround truncation compilation error sh: bios: Revive earlyprintk support ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails ASoC: ams-delta.c: use component after check mfd: dln2: Fix double put in dln2_probe leds: pwm: simplify if condition leds: pwm: convert to atomic PWM API leds: pwm: Don't disable the PWM when the LED should be off ledtrig-cpu: Limit to 8 CPUs leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' tty: tty_jobctrl: fix pid memleak in disassociate_ctty() usb: dwc2: fix possible NULL pointer dereference caused by driver concurrency dmaengine: ti: edma: handle irq_of_parse_and_map() errors misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() tools: iio: privatize globals and functions in iio_generic_buffer.c file tools: iio: iio_generic_buffer: Fix some integer type and calculation tools: iio: iio_generic_buffer ensure alignment USB: usbip: fix stub_dev hub disconnect dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host powerpc/xive: Fix endian conversion size powerpc/imc-pmu: Use the correct spinlock initializer. powerpc/pseries: fix potential memory leak in init_cpu_associativity() i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call pcmcia: cs: fix possible hung task and memory leak pccardd() pcmcia: ds: fix refcount leak in pcmcia_device_add() pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() media: bttv: fix use after free error due to btv->timeout timer media: s3c-camif: Avoid inappropriate kfree() media: dvb-usb-v2: af9035: fix missing unlock regmap: prevent noinc writes from clobbering cache pwm: sti: Avoid conditional gotos pwm: sti: Reduce number of allocations and drop usage of chip_data pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() llc: verify mac len before reading mac header tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING inet: shrink struct flowi_common dccp: Call security_inet_conn_request() after setting IPv4 addresses. dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. net: r8169: Disable multicast filter for RTL8168H and RTL8107E Fix termination state for idr_for_each_entry_ul() net: stmmac: xgmac: Enable support for multiple Flexible PPS outputs net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT tg3: power down device only on SYSTEM_POWER_OFF r8169: respect userspace disabling IFF_MULTICAST netfilter: xt_recent: fix (increase) ipv6 literal buffer length netfilter: nft_redir: use `struct nf_nat_range2` throughout and deduplicate eval call-backs netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies fbdev: imsttfb: Fix error path of imsttfb_probe() fbdev: imsttfb: fix a resource leak in probe fbdev: fsl-diu-fb: mark wr_reg_wa() static Revert "mmc: core: Capture correct oemid-bits for eMMC cards" btrfs: use u64 for buffer sizes in the tree search ioctls Linux 5.4.261 Change-Id: Iee65ff18889e15022b25cf33662c0f835825af9d Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
commit
0e07b7bd3c
122 changed files with 781 additions and 707 deletions
|
|
@ -22,9 +22,8 @@
|
|||
struct led_pwm_data {
|
||||
struct led_classdev cdev;
|
||||
struct pwm_device *pwm;
|
||||
struct pwm_state pwmstate;
|
||||
unsigned int active_low;
|
||||
unsigned int period;
|
||||
int duty;
|
||||
};
|
||||
|
||||
struct led_pwm_priv {
|
||||
|
|
@ -32,44 +31,29 @@ struct led_pwm_priv {
|
|||
struct led_pwm_data leds[0];
|
||||
};
|
||||
|
||||
static void __led_pwm_set(struct led_pwm_data *led_dat)
|
||||
{
|
||||
int new_duty = led_dat->duty;
|
||||
|
||||
pwm_config(led_dat->pwm, new_duty, led_dat->period);
|
||||
|
||||
if (new_duty == 0)
|
||||
pwm_disable(led_dat->pwm);
|
||||
else
|
||||
pwm_enable(led_dat->pwm);
|
||||
}
|
||||
|
||||
static int led_pwm_set(struct led_classdev *led_cdev,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
struct led_pwm_data *led_dat =
|
||||
container_of(led_cdev, struct led_pwm_data, cdev);
|
||||
unsigned int max = led_dat->cdev.max_brightness;
|
||||
unsigned long long duty = led_dat->period;
|
||||
unsigned long long duty = led_dat->pwmstate.period;
|
||||
|
||||
duty *= brightness;
|
||||
do_div(duty, max);
|
||||
|
||||
if (led_dat->active_low)
|
||||
duty = led_dat->period - duty;
|
||||
duty = led_dat->pwmstate.period - duty;
|
||||
|
||||
led_dat->duty = duty;
|
||||
|
||||
__led_pwm_set(led_dat);
|
||||
|
||||
return 0;
|
||||
led_dat->pwmstate.duty_cycle = duty;
|
||||
led_dat->pwmstate.enabled = true;
|
||||
return pwm_apply_state(led_dat->pwm, &led_dat->pwmstate);
|
||||
}
|
||||
|
||||
static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
|
||||
struct led_pwm *led, struct fwnode_handle *fwnode)
|
||||
{
|
||||
struct led_pwm_data *led_data = &priv->leds[priv->num_leds];
|
||||
struct pwm_args pargs;
|
||||
int ret;
|
||||
|
||||
led_data->active_low = led->active_low;
|
||||
|
|
@ -93,17 +77,10 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
|
|||
|
||||
led_data->cdev.brightness_set_blocking = led_pwm_set;
|
||||
|
||||
/*
|
||||
* FIXME: pwm_apply_args() should be removed when switching to the
|
||||
* atomic PWM API.
|
||||
*/
|
||||
pwm_apply_args(led_data->pwm);
|
||||
pwm_init_state(led_data->pwm, &led_data->pwmstate);
|
||||
|
||||
pwm_get_args(led_data->pwm, &pargs);
|
||||
|
||||
led_data->period = pargs.period;
|
||||
if (!led_data->period && (led->pwm_period_ns > 0))
|
||||
led_data->period = led->pwm_period_ns;
|
||||
if (!led_data->pwmstate.period)
|
||||
led_data->pwmstate.period = led->pwm_period_ns;
|
||||
|
||||
ret = devm_led_classdev_register(dev, &led_data->cdev);
|
||||
if (ret == 0) {
|
||||
|
|
|
|||
|
|
@ -2,14 +2,18 @@
|
|||
/*
|
||||
* ledtrig-cpu.c - LED trigger based on CPU activity
|
||||
*
|
||||
* This LED trigger will be registered for each possible CPU and named as
|
||||
* cpu0, cpu1, cpu2, cpu3, etc.
|
||||
* This LED trigger will be registered for first 8 CPUs and named
|
||||
* as cpu0..cpu7. There's additional trigger called cpu that
|
||||
* is on when any CPU is active.
|
||||
*
|
||||
* If you want support for arbitrary number of CPUs, make it one trigger,
|
||||
* with additional sysfs file selecting which CPU to watch.
|
||||
*
|
||||
* It can be bound to any LED just like other triggers using either a
|
||||
* board file or via sysfs interface.
|
||||
*
|
||||
* An API named ledtrig_cpu is exported for any user, who want to add CPU
|
||||
* activity indication in their code
|
||||
* activity indication in their code.
|
||||
*
|
||||
* Copyright 2011 Linus Walleij <linus.walleij@linaro.org>
|
||||
* Copyright 2011 - 2012 Bryan Wu <bryan.wu@canonical.com>
|
||||
|
|
@ -126,7 +130,7 @@ static int ledtrig_prepare_down_cpu(unsigned int cpu)
|
|||
|
||||
static int __init ledtrig_cpu_init(void)
|
||||
{
|
||||
int cpu;
|
||||
unsigned int cpu;
|
||||
int ret;
|
||||
|
||||
/* Supports up to 9999 cpu cores */
|
||||
|
|
@ -145,7 +149,10 @@ static int __init ledtrig_cpu_init(void)
|
|||
for_each_possible_cpu(cpu) {
|
||||
struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu);
|
||||
|
||||
snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu);
|
||||
if (cpu >= 8)
|
||||
continue;
|
||||
|
||||
snprintf(trig->name, MAX_NAME_LEN, "cpu%u", cpu);
|
||||
|
||||
led_trigger_register_simple(trig->name, &trig->_trig);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue