Merge branch 'staging/kernel-msm/MMI-U1UGS34.23-110-23-2' into lineage-22.2

Based on tag 'MMI-U1UGS34.23-110-23-2' of https://github.com/MotorolaMobilityLLC/kernel-msm

"Fogos push for Android 14"

* staging/kernel-msm/MMI-U1UGS34.23-110-23-2: (698 commits)
  mmc: sdhci-msm: Move MMC_CAP2_MAX_DISCARD_SIZE to prevent merge conflict
  Reapply "UPSTREAM: binder: fix the missing BR_FROZEN_REPLY in binder_return_strings"
  Revert "qseecom: Suppress suspend warning if without bus scaling."
  Revert "Penang: fix for device suspend tests fail. [1/2]"
  Revert "Penang: resolve kasan panic"
  Revert "Penang: kasan panic"
  Revert "penang: device suspend tests fail"
  Revert "net: qrtr: get svc_id before queueing sk_buff"
  Revert "af_unix: Do not use atomic ops for unix_sk(sk)->inflight."
  Revert "af_unix: Fix garbage collector racing against connect()"
  Revert "BACKPORT: net: fix __dst_negative_advice() race"
  Revert "ANDROID: ABI fixup for abi break in struct dst_ops"
  Revert "BACKPORT:sched: Provide sched_set_fifo()"
  Revert "msm: npu: Fix use after free issue"
  Revert "fs:EROFS:Porting 5.10 erofs to 5.4"
  Revert "BACKPORT:erofs: add per-cpu threads for decompression as an option"
  Revert "UPSTREAM: erofs: fix an error code in z_erofs_init_zip_subsystem()"
  msm: adsprpc: Avoid taking reference for group_info
  adsprpc: Handle UAF scenario in put_args
  msm: adsprpc: use-after-free (UAF) in global maps
  ...

Change-Id: Ia48438f247670d77560472205994632fa62062dd
This commit is contained in:
Michael Bestas 2025-03-21 18:12:10 +02:00
commit 869b1e64a6
No known key found for this signature in database
229 changed files with 20042 additions and 329 deletions

View file

@ -59,6 +59,7 @@ source "drivers/nfc/st-nci/Kconfig"
source "drivers/nfc/nxp-nci/Kconfig"
source "drivers/nfc/s3fwrn5/Kconfig"
source "drivers/nfc/st95hf/Kconfig"
source "drivers/nfc/samsung/Kconfig"
endmenu
config NFC_QTI_I2C

View file

@ -17,4 +17,5 @@ obj-$(CONFIG_NFC_ST_NCI) += st-nci/
obj-$(CONFIG_NFC_NXP_NCI) += nxp-nci/
obj-$(CONFIG_NFC_S3FWRN5) += s3fwrn5/
obj-$(CONFIG_NFC_ST95HF) += st95hf/
obj-$(CONFIG_SEC_NFC) += samsung/
obj-y += qti/

View file

@ -651,6 +651,40 @@ unsigned int nfc_ioctl_nfcc_info(struct file *filp, unsigned long arg)
*
* @return 0 on success, error code for failures.
*/
#ifdef CONFIG_COMPAT
long nfc_compat_dev_ioctl(struct file *pfile, unsigned int cmd, unsigned long arg)
{
int ret = 0;
struct nfc_dev *nfc_dev = pfile->private_data;
arg = (compat_u64)arg;
pr_debug("%s cmd = %x arg = %zx\n", __func__, cmd, arg);
switch (cmd) {
case NFC_SET_PWR:
ret = nfc_ioctl_power_states(nfc_dev, arg);
break;
case ESE_SET_PWR:
ret = nfc_ese_pwr(nfc_dev, arg);
break;
case ESE_GET_PWR:
ret = nfc_ese_pwr(nfc_dev, ESE_POWER_STATE);
break;
case NFCC_GET_INFO:
ret = nfc_ioctl_nfcc_info(pfile, arg);
break;
case NFC_GET_PLATFORM_TYPE:
ret = nfc_dev->interface;
break;
default:
pr_err("%s bad cmd %lu\n", __func__, arg);
ret = -ENOIOCTLCMD;
}
return ret;
}
#endif
long nfc_dev_ioctl(struct file *pfile, unsigned int cmd, unsigned long arg)
{
int ret = 0;

View file

@ -254,6 +254,9 @@ struct nfc_dev {
int nfc_dev_open(struct inode *inode, struct file *filp);
int nfc_dev_close(struct inode *inode, struct file *filp);
long nfc_dev_ioctl(struct file *pfile, unsigned int cmd, unsigned long arg);
#ifdef CONFIG_COMPAT
long nfc_compat_dev_ioctl(struct file *pfile, unsigned int cmd, unsigned long arg);
#endif
int nfc_parse_dt(struct device *dev, struct platform_gpio *nfc_gpio,
struct platform_ldo *ldo, uint8_t interface);
int nfc_misc_probe(struct nfc_dev *nfc_dev,

View file

@ -266,6 +266,9 @@ static const struct file_operations nfc_i2c_dev_fops = {
.open = nfc_dev_open,
.release = nfc_dev_close,
.unlocked_ioctl = nfc_dev_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = nfc_compat_dev_ioctl,
#endif
};
int nfc_i2c_dev_probe(struct i2c_client *client, const struct i2c_device_id *id)

View file

@ -0,0 +1,67 @@
#
# Near Field Communication (NFC) devices
#
menu "Near Field Communication (NFC) devices"
depends on NFC
config SEC_NFC
tristate "Samsung NFC driver"
default m
help
SAMSUNG NFC Driver.
This driver provides support for SAMSUNG NFC products.
You should select your NFC product and interface.
Say Y here to compile support for SAMSUNG NFC driver into the
kernel.
choice
prompt "SEC NFC Products"
depends on SEC_NFC
default SEC_NFC_PRODUCT_N5
config SEC_NFC_PRODUCT_N3
bool "RN3"
config SEC_NFC_PRODUCT_N5
bool "RN5/RNx"
endchoice
choice
prompt "SEC NFC Interface"
depends on SEC_NFC
default SEC_NFC_IF_I2C
config SEC_NFC_IF_UART
bool "UART"
config SEC_NFC_IF_I2C
bool "I2C"
config SEC_NFC_IF_I2C_GPIO
bool "I2C-GPIO (S/W-I2C)"
select I2C_CHARDEV
select I2C_MUX
select I2C_MUX_GPIO
select I2C_ARB_GPIO_CHALLENGE
select I2C_ALGOBIT
select I2C_GPIO
endchoice
config SEC_NFC_GPIO_CLK
bool "SEC NFC GPIO CLK"
default n
help
SAMSUNG NFC CLR REQ feature.
This feature provides support for SAMSUNG NFC products.
You should select this feature if your NFC product uses AP CLK.
Say Y here to compile support for SAMSUNG NFC CLK REQ feature into the
kernel.
config SEC_NFC_DEDICATED_CLK
tristate "SEC NFC DEDICATED CLK"
default m
config SEC_NFC_LDO_EN
tristate "SEC NFC LDO"
default m
config SEC_NFC_PMIC_LDO
tristate "SEC NFC PMIC LDO"
default m
config SEC_ESE_COLDRESET
tristate "eSE Cold reset"
default m
endmenu

View file

@ -0,0 +1,7 @@
#
# Makefile for Samsung NRNx NFC driver
#
obj-$(CONFIG_SEC_NFC) += sec_nfc.o
ccflags-$(CONFIG_NFC_DEBUG) := -DDEBUG

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,142 @@
/*
* SAMSUNG NFC Controller
*
* Copyright (C) 2013 Samsung Electronics Co.Ltd
* Author: Woonki Lee <woonki84.lee@samsung.com>
* Author: Heejae Kim <heejae12.kim@samsung.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Last update: 2016-01-14
*/
#include <linux/platform_device.h>
#ifdef CONFIG_SEC_NFC_GPIO_CLK
#include <linux/clk.h>
#endif
#ifdef CONFIG_SEC_NFC_PMIC_LDO
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#endif
#ifdef CONFIG_SEC_NFC_I2C /* support old driver configuration */
#ifndef CONFIG_SEC_NFC
#define CONFIG_SEC_NFC
#endif
#if !defined(CONFIG_SEC_NFC_IF_I2C) && !defined(CONFIG_SEC_NFC_IF_UART)
#define CONFIG_SEC_NFC_IF_I2C
#endif
#if !defined(CONFIG_SEC_NFC_PRODUCT_N3) && !defined(CONFIG_SEC_NFC_PRODUCT_N5)
#define CONFIG_SEC_NFC_PRODUCT_N3
#endif
#endif /* CONFIG_SEC_NFC_I2C */
#define SEC_NFC_DRIVER_NAME "sec-nfc"
#define SEC_NFC_MAX_BUFFER_SIZE 512
/* ioctl */
#define SEC_NFC_MAGIC 'S'
#define SEC_NFC_GET_MODE _IOW(SEC_NFC_MAGIC, 0, unsigned int)
#define SEC_NFC_SET_MODE _IOW(SEC_NFC_MAGIC, 1, unsigned int)
#define SEC_NFC_SLEEP _IOW(SEC_NFC_MAGIC, 2, unsigned int)
#define SEC_NFC_WAKEUP _IOW(SEC_NFC_MAGIC, 3, unsigned int)
#ifdef CONFIG_SEC_ESE_COLDRESET
#define SEC_NFC_COLD_RESET _IOW(SEC_NFC_MAGIC, 5, unsigned int)
#define SEC_NFC_SHUTDOWN _IOW(SEC_NFC_MAGIC, 6, unsigned int)
#endif
/* size */
#define SEC_NFC_MSG_MAX_SIZE (256 + 4)
/* wait for device stable */
#ifdef CONFIG_SEC_NFC_MARGINTIME
#define SEC_NFC_VEN_WAIT_TIME (150)
#else
#define SEC_NFC_VEN_WAIT_TIME (20)
#endif
/* gpio pin configuration */
struct sec_nfc_platform_data {
int irq;
int ven;
int firm;
int wake;
int pvdd_en;
unsigned int tvdd;
unsigned int avdd;
#ifdef CONFIG_SEC_ESE_COLDRESET
unsigned int coldreset;
#endif
#ifdef CONFIG_SEC_NFC_GPIO_CLK
unsigned int clk_req;
struct clk *clk;
#endif
void (*cfg_gpio)(void);
u32 ven_gpio_flags;
u32 firm_gpio_flags;
u32 irq_gpio_flags;
const char *nfc_pvdd;
#ifdef CONFIG_SEC_NFC_PMIC_LDO
const char *pvdd_regulator_name;
struct regulator *pvdd_regulator;
#endif
#ifdef CONFIG_SEC_NFC_DEDICATED_CLK
phys_addr_t clkctrl_addr;
#endif
};
enum sec_nfc_mode {
SEC_NFC_MODE_OFF = 0,
SEC_NFC_MODE_FIRMWARE,
SEC_NFC_MODE_BOOTLOADER,
SEC_NFC_MODE_COUNT,
};
#ifdef CONFIG_SEC_NFC_PRODUCT_N3
enum sec_nfc_power {
SEC_NFC_PW_OFF = 0,
SEC_NFC_PW_ON,
};
#else /* CONFIG_SEC_NFC_PRODUCT_N3 */
enum sec_nfc_power {
SEC_NFC_PW_ON = 0,
SEC_NFC_PW_OFF,
};
#endif
enum sec_nfc_firmpin {
SEC_NFC_FW_OFF = 0,
SEC_NFC_FW_ON,
};
enum sec_nfc_wake {
SEC_NFC_WAKE_SLEEP = 0,
SEC_NFC_WAKE_UP,
};
#ifdef CONFIG_SEC_ESE_COLDRESET
enum sec_nfc_coldreset{
SEC_NFC_COLDRESET_OFF = 0,
SEC_NFC_COLDRESET_ON,
};
#define FIRMWARE_GUARD_TIME (4)
#define DEVICEHOST_ID (0x00)
#define ESE_ID (0x02)
#define IDX_SLEEP_WAKEUP_NFC 0
#define IDX_SLEEP_WAKEUP_ESE 1
#endif
bool is_charging_mode;
#define NFC_I2C_LDO_ON 1
#define NFC_I2C_LDO_OFF 0