* Qualcomm PMIC8XXX keypad never worked?
From: Arnd Bergmann @ 2014-03-11 8:49 UTC (permalink / raw)
To: Stephen Boyd
Cc: Trilok Soni, Samuel Ortiz, Dmitry Torokhov, linux-kernel,
linux-arm-kernel, linux-input, Lee Jones, Anirudh Ghayal
Something in the MFD_PM8XXX driver must have changed recently that now allows
the KEYBOARD_PMIC8XXX driver to be enabled. Unfortunately, it does not build
because of a dependency on the <linux/mfd/pm8xxx/gpio.h> header file that
does not exist.
In order to keep 'make randconfig' working on my test box, I have disabled
this driver, but it would be nice of someone could have a look into fixing it.
Arnd
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -470,7 +470,7 @@ config KEYBOARD_PXA930_ROTARY
config KEYBOARD_PMIC8XXX
tristate "Qualcomm PMIC8XXX keypad support"
- depends on MFD_PM8XXX
+ depends on MFD_PM8XXX && BROKEN
select INPUT_MATRIXKMAP
help
Say Y here if you want to enable the driver for the PMIC8XXX
^ permalink raw reply
* Re: [PATCH v2 4/8] Input: pixcir_i2c_ts: Use Type-B Multi-Touch protocol
From: Roger Quadros @ 2014-03-11 9:35 UTC (permalink / raw)
To: balbi
Cc: Henrik Rydberg, dmitry.torokhov, jcbian, dmurphy, mugunthanvnm,
linux-input, linux-kernel, devicetree
In-Reply-To: <20140310163701.GA30397@saruman.home>
On 03/10/2014 06:37 PM, Felipe Balbi wrote:
> On Mon, Mar 10, 2014 at 10:57:10AM +0200, Roger Quadros wrote:
>> Hi Henrik,
>>
>> On 03/08/2014 05:11 PM, Henrik Rydberg wrote:
>>> Hi Roger,
>>>
>>> the MT implementation seems mostly fine, just one curiosity:
>>>
>>>> static irqreturn_t pixcir_ts_isr(int irq, void *dev_id)
>>>> {
>>>> struct pixcir_i2c_ts_data *tsdata = dev_id;
>>>> const struct pixcir_ts_platform_data *pdata = tsdata->chip;
>>>> + struct pixcir_report_data report;
>>>>
>>>> while (!tsdata->exiting) {
>>>> - pixcir_ts_poscheck(tsdata);
>>>> -
>>>> - if (gpio_get_value(pdata->gpio_attb))
>>>> + /* parse packet */
>>>> + pixcir_ts_parse(tsdata, &report);
>>>> +
>>>> + /* report it */
>>>> + pixcir_ts_report(tsdata, &report);
>>>> +
>>>> + if (gpio_get_value(pdata->gpio_attb)) {
>>>> + if (report.num_touches) {
>>>> + /*
>>>> + * Last report with no finger up?
>>>> + * Do it now then.
>>>> + */
>>>> + input_mt_sync_frame(tsdata->input);
>>>> + input_sync(tsdata->input);
>>>
>>> Why is this special handling needed?
>>
>> This is needed because the controller doesn't always report when all fingers
>> have left the screen. e.g. report might contain 3 fingers touched and then
>> gpio_attb line is de-asserted. There's no report with 0 fingers touched even
>> if the user's fingers have left the screen. So we never detect a BUTTON_UP.
>>
>> Without this s/w workaround we observe side effects like buttons being pressed
>> but not released. To me it looks like a bug in the controller.
>
> the other way would be to *also* use IRQF_TRIGGER_RISING, then you get
> an IRQ when fingers leave the screen. No ?
>
Yes that is also possible but it involves an additional interrupt context switch.
Sometimes the controller does report 0 finger touches before de-asserting the ATTB line and so
this additional interrupt is not needed by the approach I used.
cheers,
-roger
^ permalink raw reply
* Re: Qualcomm PMIC8XXX keypad never worked?
From: Lee Jones @ 2014-03-11 12:00 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Trilok Soni, Samuel Ortiz, Dmitry Torokhov, Stephen Boyd,
linux-kernel, linux-arm-kernel, linux-input, Anirudh Ghayal
In-Reply-To: <5887114.1jrNo21sGX@wuerfel>
> Something in the MFD_PM8XXX driver must have changed recently that now allows
> the KEYBOARD_PMIC8XXX driver to be enabled. Unfortunately, it does not build
> because of a dependency on the <linux/mfd/pm8xxx/gpio.h> header file that
> does not exist.
I have it?
-rw-r--r-- 1 lee lee 2147 Dec 18 11:52 include/linux/mfd/pm8xxx/core.h
> In order to keep 'make randconfig' working on my test box, I have disabled
> this driver, but it would be nice of someone could have a look into fixing it.
Can you send me the config that breaks please?
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> @@ -470,7 +470,7 @@ config KEYBOARD_PXA930_ROTARY
>
> config KEYBOARD_PMIC8XXX
> tristate "Qualcomm PMIC8XXX keypad support"
> - depends on MFD_PM8XXX
> + depends on MFD_PM8XXX && BROKEN
> select INPUT_MATRIXKMAP
> help
> Say Y here if you want to enable the driver for the PMIC8XXX
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: Qualcomm PMIC8XXX keypad never worked?
From: Arnd Bergmann @ 2014-03-11 12:19 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Trilok Soni, Samuel Ortiz, Dmitry Torokhov, Stephen Boyd,
linux-kernel, linux-input, Lee Jones, Anirudh Ghayal
In-Reply-To: <20140311120056.GH21216@lee--X1>
On Tuesday 11 March 2014 12:00:56 Lee Jones wrote:
> > Something in the MFD_PM8XXX driver must have changed recently that now allows
> > the KEYBOARD_PMIC8XXX driver to be enabled. Unfortunately, it does not build
> > because of a dependency on the <linux/mfd/pm8xxx/gpio.h> header file that
> > does not exist.
>
> I have it?
>
> -rw-r--r-- 1 lee lee 2147 Dec 18 11:52 include/linux/mfd/pm8xxx/core.h
This is core.h, not gpio.h
> > In order to keep 'make randconfig' working on my test box, I have disabled
> > this driver, but it would be nice of someone could have a look into fixing it.
>
> Can you send me the config that breaks please?
appended below. You might need more patches to build this, but you will get the
error if you just try building the input driver.
Arnd
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.14.0-rc5 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_HAVE_TCM=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_ARCH_HAS_CPUFREQ=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_VECTORS_BASE=0xffff0000
CONFIG_NEED_MACH_MEMORY_H=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y
#
# General setup
#
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
# CONFIG_KERNEL_GZIP is not set
CONFIG_KERNEL_LZMA=y
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
# CONFIG_SYSVIPC is not set
# CONFIG_FHANDLE is not set
CONFIG_USELIB=y
#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_KTIME_SCALAR=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
#
# Timers subsystem
#
CONFIG_HZ_PERIODIC=y
# CONFIG_NO_HZ_IDLE is not set
# CONFIG_NO_HZ is not set
# CONFIG_HIGH_RES_TIMERS is not set
#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
# CONFIG_IRQ_TIME_ACCOUNTING is not set
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
#
# RCU Subsystem
#
CONFIG_TINY_RCU=y
# CONFIG_PREEMPT_RCU is not set
# CONFIG_RCU_STALL_COMMON is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=y
CONFIG_LOG_BUF_SHIFT=17
CONFIG_GENERIC_SCHED_CLOCK=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_FREEZER=y
# CONFIG_CGROUP_DEVICE is not set
# CONFIG_CPUSETS is not set
# CONFIG_CGROUP_CPUACCT is not set
CONFIG_RESOURCE_COUNTERS=y
CONFIG_MEMCG=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_CFS_BANDWIDTH is not set
# CONFIG_RT_GROUP_SCHED is not set
# CONFIG_BLK_CGROUP is not set
CONFIG_CHECKPOINT_RESTORE=y
# CONFIG_NAMESPACES is not set
CONFIG_SCHED_AUTOGROUP=y
CONFIG_MM_OWNER=y
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_RELAY=y
# CONFIG_BLK_DEV_INITRD is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_ANON_INODES=y
CONFIG_HAVE_UID16=y
CONFIG_EXPERT=y
# CONFIG_UID16 is not set
CONFIG_SYSFS_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_PRINTK is not set
# CONFIG_BUG is not set
# CONFIG_ELF_CORE is not set
# CONFIG_BASE_FULL is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
# CONFIG_AIO is not set
CONFIG_EMBEDDED=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y
#
# Kernel Performance Events And Counters
#
# CONFIG_PERF_EVENTS is not set
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
# CONFIG_SLUB is not set
CONFIG_SLOB=y
CONFIG_MMAP_ALLOW_UNINITIALIZED=y
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_IDLE_POLL_SETUP=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
CONFIG_HAVE_CC_STACKPROTECTOR=y
CONFIG_CC_STACKPROTECTOR=y
# CONFIG_CC_STACKPROTECTOR_NONE is not set
# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
CONFIG_CC_STACKPROTECTOR_STRONG=y
CONFIG_HAVE_CONTEXT_TRACKING=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_REL=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_OLD_SIGACTION=y
#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=1
# CONFIG_SYSTEM_TRUSTED_KEYRING is not set
# CONFIG_MODULES is not set
CONFIG_BLOCK=y
CONFIG_LBDAF=y
CONFIG_BLK_DEV_BSG=y
# CONFIG_BLK_DEV_BSGLIB is not set
CONFIG_BLK_DEV_INTEGRITY=y
# CONFIG_BLK_CMDLINE_PARSER is not set
#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
# CONFIG_ACORN_PARTITION is not set
# CONFIG_AIX_PARTITION is not set
# CONFIG_OSF_PARTITION is not set
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
# CONFIG_MAC_PARTITION is not set
# CONFIG_MSDOS_PARTITION is not set
# CONFIG_LDM_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
# CONFIG_KARMA_PARTITION is not set
CONFIG_EFI_PARTITION=y
# CONFIG_SYSV68_PARTITION is not set
# CONFIG_CMDLINE_PARTITION is not set
#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
# CONFIG_IOSCHED_CFQ is not set
CONFIG_DEFAULT_DEADLINE=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="deadline"
CONFIG_ASN1=y
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_FREEZER=y
#
# System Type
#
# CONFIG_MMU is not set
# CONFIG_ARCH_MULTIPLATFORM is not set
CONFIG_ARCH_INTEGRATOR=y
# CONFIG_ARCH_REALVIEW is not set
# CONFIG_ARCH_VERSATILE is not set
# CONFIG_ARCH_AT91 is not set
# CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_GEMINI is not set
# CONFIG_ARCH_EBSA110 is not set
# CONFIG_ARCH_EFM32 is not set
# CONFIG_ARCH_EP93XX is not set
# CONFIG_ARCH_FOOTBRIDGE is not set
# CONFIG_ARCH_NETX is not set
# CONFIG_ARCH_DOVE is not set
# CONFIG_ARCH_KIRKWOOD is not set
# CONFIG_ARCH_MV78XX0 is not set
# CONFIG_ARCH_KS8695 is not set
# CONFIG_ARCH_W90X900 is not set
# CONFIG_ARCH_LPC32XX is not set
# CONFIG_ARCH_MSM is not set
# CONFIG_ARCH_SHMOBILE_LEGACY is not set
# CONFIG_ARCH_S3C24XX is not set
# CONFIG_ARCH_S3C64XX is not set
# CONFIG_ARCH_S5P64X0 is not set
# CONFIG_ARCH_S5PC100 is not set
# CONFIG_ARCH_S5PV210 is not set
# CONFIG_ARCH_EXYNOS is not set
# CONFIG_ARCH_DAVINCI is not set
CONFIG_BROKEN_MULTIPLATFORM=y
#
# Integrator Options
#
# CONFIG_ARCH_INTEGRATOR_V4_V5 is not set
CONFIG_ARCH_INTEGRATOR_V6_V7=y
CONFIG_ARCH_INTEGRATOR_AP=y
# CONFIG_ARCH_INTEGRATOR_CP is not set
CONFIG_ARCH_INTEGRATOR_AUTO=y
CONFIG_INTEGRATOR_IMPD1=y
# CONFIG_PLAT_SPEAR is not set
CONFIG_PLAT_VERSATILE_SCHED_CLOCK=y
CONFIG_PLAT_VERSATILE=y
#
# Processor Type
#
# CONFIG_CPU_V6 is not set
# CONFIG_CPU_V6K is not set
CONFIG_CPU_V7=y
CONFIG_CPU_32v6K=y
CONFIG_CPU_32v7=y
CONFIG_CPU_ABRT_EV7=y
CONFIG_CPU_PABRT_V7=y
CONFIG_CPU_CACHE_V7=y
CONFIG_CPU_CACHE_VIPT=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MPU=y
#
# Processor Features
#
# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
CONFIG_ARM_THUMB=y
# CONFIG_ARM_THUMBEE is not set
# CONFIG_SWP_EMULATE is not set
CONFIG_CPU_HIGH_VECTOR=y
# CONFIG_CPU_ICACHE_DISABLE is not set
# CONFIG_CPU_DCACHE_DISABLE is not set
# CONFIG_CPU_BPREDICT_DISABLE is not set
CONFIG_KUSER_HELPERS=y
# CONFIG_CACHE_L2X0 is not set
CONFIG_ARM_L1_CACHE_SHIFT_6=y
CONFIG_ARM_L1_CACHE_SHIFT=6
CONFIG_ARM_DMA_MEM_BUFFERABLE=y
CONFIG_ARM_NR_BANKS=8
CONFIG_MULTI_IRQ_HANDLER=y
CONFIG_SET_MEM_PARAM=y
CONFIG_DRAM_BASE=0x00800000
CONFIG_DRAM_SIZE=0x00800000
CONFIG_FLASH_MEM_BASE=0x00400000
CONFIG_FLASH_SIZE=0x00400000
CONFIG_ARM_MPU=y
# CONFIG_ARM_ERRATA_430973 is not set
# CONFIG_ARM_ERRATA_458693 is not set
# CONFIG_ARM_ERRATA_460075 is not set
# CONFIG_ARM_ERRATA_720789 is not set
# CONFIG_ARM_ERRATA_743622 is not set
# CONFIG_ARM_ERRATA_751472 is not set
# CONFIG_ARM_ERRATA_754322 is not set
# CONFIG_ARM_ERRATA_775420 is not set
# CONFIG_ARM_ERRATA_773022 is not set
CONFIG_ICST=y
#
# Bus support
#
CONFIG_ARM_AMBA=y
# CONFIG_PCI is not set
# CONFIG_PCI_SYSCALL is not set
# CONFIG_PCCARD is not set
#
# Kernel Features
#
# CONFIG_HAVE_ARM_ARCH_TIMER is not set
# CONFIG_VMSPLIT_3G is not set
CONFIG_VMSPLIT_2G=y
# CONFIG_VMSPLIT_1G is not set
CONFIG_PAGE_OFFSET=0x00800000
# CONFIG_ARM_PSCI is not set
CONFIG_ARCH_NR_GPIO=0
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_HZ_FIXED=0
# CONFIG_HZ_100 is not set
# CONFIG_HZ_200 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_500=y
# CONFIG_HZ_1000 is not set
CONFIG_HZ=500
# CONFIG_SCHED_HRTICK is not set
# CONFIG_THUMB2_KERNEL is not set
CONFIG_AEABI=y
CONFIG_OABI_COMPAT=y
# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
CONFIG_HAVE_ARCH_PFN_VALID=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_NO_BOOTMEM=y
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=999999
# CONFIG_PHYS_ADDR_T_64BIT is not set
CONFIG_ZONE_DMA_FLAG=0
CONFIG_NEED_BOUNCE_POOL=y
CONFIG_NOMMU_INITIAL_TRIM_EXCESS=1
CONFIG_NEED_PER_CPU_KM=y
# CONFIG_CLEANCACHE is not set
# CONFIG_ZBUD is not set
CONFIG_FORCE_MAX_ZONEORDER=11
# CONFIG_SECCOMP is not set
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
#
# Boot options
#
CONFIG_USE_OF=y
# CONFIG_ATAGS is not set
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZBOOT_ROM_BSS=0
# CONFIG_ARM_APPENDED_DTB is not set
CONFIG_CMDLINE=""
CONFIG_XIP_KERNEL=y
CONFIG_XIP_PHYS_ADDR=0x00080000
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
CONFIG_AUTO_ZRELADDR=y
#
# CPU Power Management
#
#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
# CONFIG_GENERIC_CPUFREQ_CPU0 is not set
#
# ARM CPU frequency scaling drivers
#
# CONFIG_ARM_INTEGRATOR is not set
# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
#
# CPU Idle
#
# CONFIG_CPU_IDLE is not set
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
#
# Floating point emulation
#
#
# At least one emulation must be selected
#
# CONFIG_FPE_NWFPE is not set
CONFIG_FPE_FASTFPE=y
# CONFIG_VFP is not set
#
# Userspace binary formats
#
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_BINFMT_SCRIPT=y
# CONFIG_BINFMT_FLAT is not set
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=y
CONFIG_COREDUMP=y
#
# Power management options
#
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_PM_SLEEP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM_RUNTIME=y
CONFIG_PM=y
CONFIG_PM_DEBUG=y
CONFIG_PM_ADVANCED_DEBUG=y
CONFIG_PM_SLEEP_DEBUG=y
CONFIG_APM_EMULATION=y
CONFIG_PM_CLK=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_CPU_PM=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARM_CPU_SUSPEND=y
# CONFIG_NET is not set
CONFIG_HAVE_BPF_JIT=y
#
# Device Drivers
#
#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_DEBUG_DRIVER=y
CONFIG_DEBUG_DEVRES=y
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_SOC_BUS=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGMAP_IRQ=y
# CONFIG_DMA_SHARED_BUFFER is not set
#
# Bus devices
#
# CONFIG_ARM_CCI is not set
# CONFIG_MTD is not set
CONFIG_DTC=y
CONFIG_OF=y
#
# Device Tree and Open Firmware support
#
# CONFIG_OF_SELFTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
CONFIG_PARPORT=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
# CONFIG_PARPORT_PC is not set
# CONFIG_PARPORT_GSC is not set
CONFIG_PARPORT_AX88796=y
# CONFIG_PARPORT_1284 is not set
CONFIG_PARPORT_NOT_PC=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_NULL_BLK is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set
#
# DRBD disabled because PROC_FS or INET not selected
#
CONFIG_BLK_DEV_OSD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
# CONFIG_BLK_DEV_XIP is not set
CONFIG_CDROM_PKTCDVD=y
CONFIG_CDROM_PKTCDVD_BUFFERS=8
CONFIG_CDROM_PKTCDVD_WCACHE=y
# CONFIG_MG_DISK is not set
#
# Misc devices
#
CONFIG_SENSORS_LIS3LV02D=y
CONFIG_AD525X_DPOT=y
CONFIG_AD525X_DPOT_I2C=y
CONFIG_DUMMY_IRQ=y
CONFIG_ICS932S401=y
CONFIG_ATMEL_SSC=y
# CONFIG_ENCLOSURE_SERVICES is not set
CONFIG_APDS9802ALS=y
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
CONFIG_SENSORS_TSL2550=y
# CONFIG_SENSORS_BH1780 is not set
CONFIG_SENSORS_BH1770=y
# CONFIG_SENSORS_APDS990X is not set
CONFIG_HMC6352=y
CONFIG_DS1682=y
CONFIG_ARM_CHARLCD=y
CONFIG_BMP085=y
CONFIG_BMP085_I2C=y
CONFIG_USB_SWITCH_FSA9480=y
CONFIG_SRAM=y
CONFIG_C2PORT=y
#
# EEPROM support
#
CONFIG_EEPROM_AT24=y
# CONFIG_EEPROM_LEGACY is not set
# CONFIG_EEPROM_MAX6875 is not set
# CONFIG_EEPROM_93CX6 is not set
#
# Texas Instruments shared transport line discipline
#
CONFIG_SENSORS_LIS3_I2C=y
#
# Altera FPGA firmware download module
#
# CONFIG_ALTERA_STAPL is not set
#
# Intel MIC Host Driver
#
#
# Intel MIC Card Driver
#
# CONFIG_ECHO is not set
#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
# CONFIG_SCSI_NETLINK is not set
#
# SCSI support type (disk, tape, CD-ROM)
#
# CONFIG_BLK_DEV_SD is not set
CONFIG_CHR_DEV_ST=y
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
CONFIG_CHR_DEV_SCH=y
CONFIG_SCSI_MULTI_LUN=y
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set
# CONFIG_SCSI_SCAN_ASYNC is not set
#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
# CONFIG_SCSI_FC_ATTRS is not set
CONFIG_SCSI_SAS_ATTRS=y
CONFIG_SCSI_SAS_LIBSAS=y
CONFIG_SCSI_SAS_ATA=y
CONFIG_SCSI_SAS_HOST_SMP=y
# CONFIG_SCSI_SRP_ATTRS is not set
# CONFIG_SCSI_LOWLEVEL is not set
# CONFIG_SCSI_DH is not set
CONFIG_SCSI_OSD_INITIATOR=y
CONFIG_SCSI_OSD_ULD=y
CONFIG_SCSI_OSD_DPRINT_SENSE=1
# CONFIG_SCSI_OSD_DEBUG is not set
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_SATA_PMP=y
#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI_PLATFORM=y
# CONFIG_AHCI_IMX is not set
CONFIG_ATA_SFF=y
#
# SFF controllers with custom DMA interface
#
CONFIG_ATA_BMDMA=y
#
# SATA SFF controllers with BMDMA
#
CONFIG_SATA_HIGHBANK=y
CONFIG_SATA_MV=y
CONFIG_SATA_RCAR=y
#
# PATA SFF controllers with BMDMA
#
#
# PIO-only SFF controllers
#
CONFIG_PATA_PLATFORM=y
# CONFIG_PATA_OF_PLATFORM is not set
#
# Generic fallback / legacy drivers
#
# CONFIG_MD is not set
CONFIG_TARGET_CORE=y
CONFIG_TCM_IBLOCK=y
CONFIG_TCM_FILEIO=y
CONFIG_TCM_PSCSI=y
# CONFIG_LOOPBACK_TARGET is not set
#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_FF_MEMLESS=y
CONFIG_INPUT_POLLDEV=y
CONFIG_INPUT_SPARSEKMAP=y
CONFIG_INPUT_MATRIXKMAP=y
#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=y
CONFIG_INPUT_APMPOWER=y
#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ADP5588=y
# CONFIG_KEYBOARD_ADP5589 is not set
CONFIG_KEYBOARD_ATKBD=y
CONFIG_KEYBOARD_QT1070=y
# CONFIG_KEYBOARD_QT2160 is not set
CONFIG_KEYBOARD_LKKBD=y
# CONFIG_KEYBOARD_GPIO is not set
CONFIG_KEYBOARD_GPIO_POLLED=y
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
CONFIG_KEYBOARD_MATRIX=y
# CONFIG_KEYBOARD_LM8323 is not set
CONFIG_KEYBOARD_LM8333=y
CONFIG_KEYBOARD_MAX7359=y
CONFIG_KEYBOARD_MCS=y
CONFIG_KEYBOARD_MPR121=y
# CONFIG_KEYBOARD_NEWTON is not set
CONFIG_KEYBOARD_OPENCORES=y
CONFIG_KEYBOARD_PMIC8XXX=y
CONFIG_KEYBOARD_SAMSUNG=y
CONFIG_KEYBOARD_STOWAWAY=y
CONFIG_KEYBOARD_SUNKBD=y
CONFIG_KEYBOARD_STMPE=y
CONFIG_KEYBOARD_TC3589X=y
# CONFIG_KEYBOARD_TWL4030 is not set
CONFIG_KEYBOARD_XTKBD=y
CONFIG_KEYBOARD_CROS_EC=y
# CONFIG_INPUT_LEDS is not set
CONFIG_INPUT_MOUSE=y
# CONFIG_MOUSE_PS2 is not set
CONFIG_MOUSE_SERIAL=y
CONFIG_MOUSE_CYAPA=y
# CONFIG_MOUSE_VSXXXAA is not set
CONFIG_MOUSE_GPIO=y
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
CONFIG_INPUT_JOYSTICK=y
CONFIG_JOYSTICK_ANALOG=y
# CONFIG_JOYSTICK_A3D is not set
CONFIG_JOYSTICK_ADI=y
CONFIG_JOYSTICK_COBRA=y
CONFIG_JOYSTICK_GF2K=y
CONFIG_JOYSTICK_GRIP=y
# CONFIG_JOYSTICK_GRIP_MP is not set
CONFIG_JOYSTICK_GUILLEMOT=y
CONFIG_JOYSTICK_INTERACT=y
CONFIG_JOYSTICK_SIDEWINDER=y
CONFIG_JOYSTICK_TMDC=y
CONFIG_JOYSTICK_IFORCE=y
CONFIG_JOYSTICK_IFORCE_232=y
CONFIG_JOYSTICK_WARRIOR=y
CONFIG_JOYSTICK_MAGELLAN=y
CONFIG_JOYSTICK_SPACEORB=y
# CONFIG_JOYSTICK_SPACEBALL is not set
CONFIG_JOYSTICK_STINGER=y
CONFIG_JOYSTICK_TWIDJOY=y
CONFIG_JOYSTICK_ZHENHUA=y
CONFIG_JOYSTICK_DB9=y
CONFIG_JOYSTICK_GAMECON=y
CONFIG_JOYSTICK_TURBOGRAFX=y
# CONFIG_JOYSTICK_AS5011 is not set
CONFIG_JOYSTICK_JOYDUMP=y
# CONFIG_INPUT_TABLET is not set
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_AD7879=y
CONFIG_TOUCHSCREEN_AD7879_I2C=y
CONFIG_TOUCHSCREEN_ATMEL_MXT=y
CONFIG_TOUCHSCREEN_AUO_PIXCIR=y
CONFIG_TOUCHSCREEN_BU21013=y
CONFIG_TOUCHSCREEN_CY8CTMG110=y
# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
CONFIG_TOUCHSCREEN_CYTTSP4_CORE=y
CONFIG_TOUCHSCREEN_CYTTSP4_I2C=y
CONFIG_TOUCHSCREEN_DA9034=y
# CONFIG_TOUCHSCREEN_DYNAPRO is not set
CONFIG_TOUCHSCREEN_HAMPSHIRE=y
CONFIG_TOUCHSCREEN_EETI=y
CONFIG_TOUCHSCREEN_EGALAX=y
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_ILI210X is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
CONFIG_TOUCHSCREEN_ELO=y
CONFIG_TOUCHSCREEN_WACOM_W8001=y
CONFIG_TOUCHSCREEN_WACOM_I2C=y
CONFIG_TOUCHSCREEN_MAX11801=y
CONFIG_TOUCHSCREEN_MCS5000=y
CONFIG_TOUCHSCREEN_MMS114=y
CONFIG_TOUCHSCREEN_MTOUCH=y
CONFIG_TOUCHSCREEN_INEXIO=y
# CONFIG_TOUCHSCREEN_MK712 is not set
# CONFIG_TOUCHSCREEN_PENMOUNT is not set
# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
CONFIG_TOUCHSCREEN_TOUCHRIGHT=y
CONFIG_TOUCHSCREEN_TOUCHWIN=y
CONFIG_TOUCHSCREEN_TI_AM335X_TSC=y
CONFIG_TOUCHSCREEN_PIXCIR=y
# CONFIG_TOUCHSCREEN_WM831X is not set
CONFIG_TOUCHSCREEN_MC13783=y
CONFIG_TOUCHSCREEN_TOUCHIT213=y
CONFIG_TOUCHSCREEN_TSC_SERIO=y
CONFIG_TOUCHSCREEN_TSC2007=y
CONFIG_TOUCHSCREEN_W90X900=y
# CONFIG_TOUCHSCREEN_ST1232 is not set
CONFIG_TOUCHSCREEN_STMPE=y
# CONFIG_TOUCHSCREEN_TPS6507X is not set
# CONFIG_TOUCHSCREEN_ZFORCE is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_88PM80X_ONKEY=y
CONFIG_INPUT_AD714X=y
CONFIG_INPUT_AD714X_I2C=y
CONFIG_INPUT_BMA150=y
# CONFIG_INPUT_PM8XXX_VIBRATOR is not set
# CONFIG_INPUT_PMIC8XXX_PWRKEY is not set
# CONFIG_INPUT_MAX8925_ONKEY is not set
CONFIG_INPUT_MC13783_PWRBUTTON=y
CONFIG_INPUT_MMA8450=y
# CONFIG_INPUT_MPU3050 is not set
# CONFIG_INPUT_GP2A is not set
CONFIG_INPUT_GPIO_BEEPER=y
CONFIG_INPUT_GPIO_TILT_POLLED=y
CONFIG_INPUT_KXTJ9=y
CONFIG_INPUT_KXTJ9_POLLED_MODE=y
CONFIG_INPUT_RETU_PWRBUTTON=y
CONFIG_INPUT_TWL4030_PWRBUTTON=y
CONFIG_INPUT_TWL4030_VIBRA=y
CONFIG_INPUT_UINPUT=y
CONFIG_INPUT_PCF50633_PMU=y
CONFIG_INPUT_PCF8574=y
CONFIG_INPUT_GPIO_ROTARY_ENCODER=y
CONFIG_INPUT_WM831X_ON=y
# CONFIG_INPUT_ADXL34X is not set
CONFIG_INPUT_CMA3000=y
# CONFIG_INPUT_CMA3000_I2C is not set
#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_SERPORT=y
CONFIG_SERIO_PARKBD=y
# CONFIG_SERIO_AMBAKMI is not set
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=y
# CONFIG_SERIO_ALTERA_PS2 is not set
CONFIG_SERIO_PS2MULT=y
CONFIG_SERIO_ARC_PS2=y
CONFIG_SERIO_APBPS2=y
# CONFIG_SERIO_OLPC_APSP is not set
CONFIG_GAMEPORT=y
CONFIG_GAMEPORT_NS558=y
CONFIG_GAMEPORT_L4=y
#
# Character devices
#
CONFIG_TTY=y
# CONFIG_VT is not set
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_NONSTANDARD=y
CONFIG_N_HDLC=y
# CONFIG_TRACE_ROUTER is not set
CONFIG_TRACE_SINK=y
# CONFIG_DEVKMEM is not set
#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
# CONFIG_SERIAL_8250_CONSOLE is not set
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
# CONFIG_SERIAL_8250_MANY_PORTS is not set
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_RSA is not set
CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_8250_EM=y
#
# Non-8250 serial port support
#
CONFIG_SERIAL_AMBA_PL010=y
CONFIG_SERIAL_AMBA_PL010_CONSOLE=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_SERIAL_SCCNXP is not set
CONFIG_SERIAL_TIMBERDALE=y
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
CONFIG_SERIAL_ALTERA_UART=y
CONFIG_SERIAL_ALTERA_UART_MAXPORTS=4
CONFIG_SERIAL_ALTERA_UART_BAUDRATE=115200
CONFIG_SERIAL_ALTERA_UART_CONSOLE=y
CONFIG_SERIAL_XILINX_PS_UART=y
CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_FSL_LPUART is not set
CONFIG_SERIAL_ST_ASC=y
CONFIG_SERIAL_ST_ASC_CONSOLE=y
# CONFIG_TTY_PRINTK is not set
# CONFIG_PRINTER is not set
CONFIG_PPDEV=y
# CONFIG_HVC_DCC is not set
CONFIG_IPMI_HANDLER=y
# CONFIG_IPMI_PANIC_EVENT is not set
CONFIG_IPMI_DEVICE_INTERFACE=y
CONFIG_IPMI_SI=y
CONFIG_IPMI_WATCHDOG=y
# CONFIG_IPMI_POWEROFF is not set
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_TIMERIOMEM=y
CONFIG_HW_RANDOM_ATMEL=y
# CONFIG_HW_RANDOM_EXYNOS is not set
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
#
# Multiplexer I2C Chip support
#
CONFIG_I2C_ARB_GPIO_CHALLENGE=y
# CONFIG_I2C_MUX_GPIO is not set
CONFIG_I2C_MUX_PCA9541=y
# CONFIG_I2C_MUX_PCA954x is not set
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_SMBUS=y
#
# I2C Algorithms
#
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_ALGOPCF=y
CONFIG_I2C_ALGOPCA=y
#
# I2C Hardware Bus support
#
#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
CONFIG_I2C_CBUS_GPIO=y
# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
CONFIG_I2C_GPIO=y
CONFIG_I2C_NOMADIK=y
# CONFIG_I2C_OCORES is not set
CONFIG_I2C_PCA_PLATFORM=y
# CONFIG_I2C_PXA_PCI is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set
#
# External I2C/SMBus adapter drivers
#
CONFIG_I2C_PARPORT=y
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_TAOS_EVM is not set
#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_DEBUG_CORE is not set
CONFIG_I2C_DEBUG_ALGO=y
CONFIG_I2C_DEBUG_BUS=y
# CONFIG_SPI is not set
CONFIG_SPMI=y
CONFIG_HSI=y
CONFIG_HSI_BOARDINFO=y
#
# HSI clients
#
CONFIG_HSI_CHAR=y
#
# PPS support
#
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set
# CONFIG_NTP_PPS is not set
#
# PPS clients support
#
CONFIG_PPS_CLIENT_KTIMER=y
CONFIG_PPS_CLIENT_LDISC=y
CONFIG_PPS_CLIENT_PARPORT=y
# CONFIG_PPS_CLIENT_GPIO is not set
#
# PPS generators support
#
#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK=y
#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
CONFIG_ARCH_REQUIRE_GPIOLIB=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_DEVRES=y
CONFIG_OF_GPIO=y
# CONFIG_DEBUG_GPIO is not set
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_GENERIC=y
CONFIG_GPIO_MAX730X=y
#
# Memory mapped GPIO drivers:
#
CONFIG_GPIO_GENERIC_PLATFORM=y
# CONFIG_GPIO_DWAPB is not set
# CONFIG_GPIO_EM is not set
# CONFIG_GPIO_ZEVIO is not set
CONFIG_GPIO_PL061=y
# CONFIG_GPIO_RCAR is not set
# CONFIG_GPIO_SCH311X is not set
# CONFIG_GPIO_GRGPIO is not set
#
# I2C GPIO expanders:
#
CONFIG_GPIO_ARIZONA=y
CONFIG_GPIO_MAX7300=y
CONFIG_GPIO_MAX732X=y
CONFIG_GPIO_MAX732X_IRQ=y
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_RC5T583 is not set
# CONFIG_GPIO_SX150X is not set
CONFIG_GPIO_STMPE=y
CONFIG_GPIO_TC3589X=y
CONFIG_GPIO_TWL4030=y
CONFIG_GPIO_WM831X=y
CONFIG_GPIO_WM8350=y
CONFIG_GPIO_WM8994=y
CONFIG_GPIO_ADP5588=y
# CONFIG_GPIO_ADP5588_IRQ is not set
# CONFIG_GPIO_ADNP is not set
#
# PCI GPIO expanders:
#
#
# SPI GPIO expanders:
#
# CONFIG_GPIO_MCP23S08 is not set
#
# AC97 GPIO expanders:
#
#
# LPC GPIO expanders:
#
#
# MODULbus GPIO expanders:
#
# CONFIG_GPIO_TPS6586X is not set
CONFIG_GPIO_BCM_KONA=y
#
# USB GPIO expanders:
#
CONFIG_W1=y
#
# 1-wire Bus Masters
#
CONFIG_W1_MASTER_DS2482=y
# CONFIG_W1_MASTER_DS1WM is not set
CONFIG_W1_MASTER_GPIO=y
#
# 1-wire Slaves
#
CONFIG_W1_SLAVE_THERM=y
CONFIG_W1_SLAVE_SMEM=y
CONFIG_W1_SLAVE_DS2408=y
CONFIG_W1_SLAVE_DS2408_READBACK=y
CONFIG_W1_SLAVE_DS2413=y
CONFIG_W1_SLAVE_DS2423=y
CONFIG_W1_SLAVE_DS2431=y
CONFIG_W1_SLAVE_DS2433=y
# CONFIG_W1_SLAVE_DS2433_CRC is not set
CONFIG_W1_SLAVE_DS2760=y
CONFIG_W1_SLAVE_DS2780=y
CONFIG_W1_SLAVE_DS2781=y
CONFIG_W1_SLAVE_DS28E04=y
CONFIG_W1_SLAVE_BQ27000=y
CONFIG_POWER_SUPPLY=y
CONFIG_POWER_SUPPLY_DEBUG=y
CONFIG_PDA_POWER=y
CONFIG_APM_POWER=y
# CONFIG_GENERIC_ADC_BATTERY is not set
CONFIG_MAX8925_POWER=y
CONFIG_WM831X_BACKUP=y
CONFIG_WM831X_POWER=y
# CONFIG_WM8350_POWER is not set
CONFIG_TEST_POWER=y
# CONFIG_BATTERY_DS2760 is not set
# CONFIG_BATTERY_DS2780 is not set
# CONFIG_BATTERY_DS2781 is not set
CONFIG_BATTERY_DS2782=y
# CONFIG_BATTERY_SBS is not set
CONFIG_BATTERY_BQ27x00=y
# CONFIG_BATTERY_BQ27X00_I2C is not set
# CONFIG_BATTERY_BQ27X00_PLATFORM is not set
# CONFIG_BATTERY_DA9030 is not set
CONFIG_BATTERY_MAX17040=y
CONFIG_BATTERY_MAX17042=y
CONFIG_BATTERY_TWL4030_MADC=y
CONFIG_CHARGER_PCF50633=y
# CONFIG_BATTERY_RX51 is not set
CONFIG_CHARGER_MAX8903=y
CONFIG_CHARGER_TWL4030=y
CONFIG_CHARGER_LP8727=y
# CONFIG_CHARGER_GPIO is not set
CONFIG_CHARGER_MAX8997=y
# CONFIG_CHARGER_MAX8998 is not set
# CONFIG_CHARGER_BQ2415X is not set
CONFIG_CHARGER_BQ24190=y
CONFIG_CHARGER_BQ24735=y
CONFIG_CHARGER_SMB347=y
# CONFIG_CHARGER_TPS65090 is not set
CONFIG_POWER_RESET=y
# CONFIG_POWER_RESET_AS3722 is not set
# CONFIG_POWER_RESET_GPIO is not set
CONFIG_POWER_RESET_RESTART=y
CONFIG_POWER_AVS=y
CONFIG_HWMON=y
CONFIG_HWMON_VID=y
# CONFIG_HWMON_DEBUG_CHIP is not set
#
# Native drivers
#
# CONFIG_SENSORS_AD7414 is not set
CONFIG_SENSORS_AD7418=y
# CONFIG_SENSORS_ADM1021 is not set
CONFIG_SENSORS_ADM1025=y
CONFIG_SENSORS_ADM1026=y
# CONFIG_SENSORS_ADM1029 is not set
CONFIG_SENSORS_ADM1031=y
# CONFIG_SENSORS_ADM9240 is not set
CONFIG_SENSORS_ADT7X10=y
CONFIG_SENSORS_ADT7410=y
CONFIG_SENSORS_ADT7411=y
CONFIG_SENSORS_ADT7462=y
CONFIG_SENSORS_ADT7470=y
CONFIG_SENSORS_ADT7475=y
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_ATXP1 is not set
CONFIG_SENSORS_DS620=y
CONFIG_SENSORS_DS1621=y
CONFIG_SENSORS_F71805F=y
CONFIG_SENSORS_F71882FG=y
CONFIG_SENSORS_F75375S=y
CONFIG_SENSORS_MC13783_ADC=y
CONFIG_SENSORS_GL518SM=y
CONFIG_SENSORS_GL520SM=y
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_G762 is not set
CONFIG_SENSORS_GPIO_FAN=y
# CONFIG_SENSORS_HIH6130 is not set
CONFIG_SENSORS_IBMAEM=y
CONFIG_SENSORS_IBMPEX=y
# CONFIG_SENSORS_IIO_HWMON is not set
CONFIG_SENSORS_IT87=y
CONFIG_SENSORS_JC42=y
CONFIG_SENSORS_LINEAGE=y
CONFIG_SENSORS_LTC2945=y
CONFIG_SENSORS_LTC4151=y
# CONFIG_SENSORS_LTC4215 is not set
CONFIG_SENSORS_LTC4222=y
CONFIG_SENSORS_LTC4245=y
CONFIG_SENSORS_LTC4260=y
CONFIG_SENSORS_LTC4261=y
CONFIG_SENSORS_MAX16065=y
CONFIG_SENSORS_MAX1619=y
CONFIG_SENSORS_MAX1668=y
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_MAX6639 is not set
CONFIG_SENSORS_MAX6642=y
CONFIG_SENSORS_MAX6650=y
CONFIG_SENSORS_MAX6697=y
CONFIG_SENSORS_HTU21=y
# CONFIG_SENSORS_MCP3021 is not set
CONFIG_SENSORS_LM63=y
CONFIG_SENSORS_LM73=y
CONFIG_SENSORS_LM75=y
CONFIG_SENSORS_LM77=y
CONFIG_SENSORS_LM78=y
# CONFIG_SENSORS_LM80 is not set
CONFIG_SENSORS_LM83=y
# CONFIG_SENSORS_LM85 is not set
CONFIG_SENSORS_LM87=y
CONFIG_SENSORS_LM90=y
CONFIG_SENSORS_LM92=y
CONFIG_SENSORS_LM93=y
# CONFIG_SENSORS_LM95234 is not set
CONFIG_SENSORS_LM95241=y
CONFIG_SENSORS_LM95245=y
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
CONFIG_SENSORS_NTC_THERMISTOR=y
# CONFIG_SENSORS_NCT6775 is not set
CONFIG_SENSORS_PCF8591=y
CONFIG_PMBUS=y
CONFIG_SENSORS_PMBUS=y
CONFIG_SENSORS_ADM1275=y
# CONFIG_SENSORS_LM25066 is not set
# CONFIG_SENSORS_LTC2978 is not set
CONFIG_SENSORS_MAX16064=y
CONFIG_SENSORS_MAX34440=y
# CONFIG_SENSORS_MAX8688 is not set
CONFIG_SENSORS_UCD9000=y
CONFIG_SENSORS_UCD9200=y
CONFIG_SENSORS_ZL6100=y
CONFIG_SENSORS_SHT15=y
CONFIG_SENSORS_SHT21=y
CONFIG_SENSORS_DME1737=y
CONFIG_SENSORS_EMC1403=y
CONFIG_SENSORS_EMC2103=y
# CONFIG_SENSORS_EMC6W201 is not set
CONFIG_SENSORS_SMSC47M1=y
CONFIG_SENSORS_SMSC47M192=y
CONFIG_SENSORS_SMSC47B397=y
CONFIG_SENSORS_SCH56XX_COMMON=y
# CONFIG_SENSORS_SCH5627 is not set
CONFIG_SENSORS_SCH5636=y
CONFIG_SENSORS_SMM665=y
CONFIG_SENSORS_ADC128D818=y
# CONFIG_SENSORS_ADS1015 is not set
# CONFIG_SENSORS_ADS7828 is not set
CONFIG_SENSORS_AMC6821=y
# CONFIG_SENSORS_INA209 is not set
# CONFIG_SENSORS_INA2XX is not set
CONFIG_SENSORS_THMC50=y
CONFIG_SENSORS_TMP102=y
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
CONFIG_SENSORS_TWL4030_MADC=y
CONFIG_SENSORS_VT1211=y
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
CONFIG_SENSORS_W83792D=y
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83795 is not set
CONFIG_SENSORS_W83L785TS=y
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
CONFIG_SENSORS_W83627EHF=y
# CONFIG_SENSORS_WM831X is not set
CONFIG_SENSORS_WM8350=y
CONFIG_THERMAL=y
CONFIG_THERMAL_HWMON=y
CONFIG_THERMAL_OF=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
# CONFIG_THERMAL_GOV_USER_SPACE is not set
CONFIG_CPU_THERMAL=y
CONFIG_THERMAL_EMULATION=y
CONFIG_IMX_THERMAL=y
#
# Texas Instruments thermal drivers
#
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_GPIO_WATCHDOG is not set
# CONFIG_WM831X_WATCHDOG is not set
# CONFIG_WM8350_WATCHDOG is not set
CONFIG_XILINX_WATCHDOG=y
CONFIG_ARM_SP805_WATCHDOG=y
CONFIG_DW_WATCHDOG=y
CONFIG_TWL4030_WATCHDOG=y
# CONFIG_MAX63XX_WATCHDOG is not set
# CONFIG_RETU_WATCHDOG is not set
CONFIG_MEN_A21_WDT=y
CONFIG_SSB_POSSIBLE=y
#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y
#
# Broadcom specific AMBA
#
CONFIG_BCMA=y
CONFIG_BCMA_HOST_SOC=y
# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
CONFIG_BCMA_DRIVER_GPIO=y
# CONFIG_BCMA_DEBUG is not set
#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_AS3711 is not set
CONFIG_MFD_AS3722=y
# CONFIG_PMIC_ADP5520 is not set
CONFIG_MFD_AAT2870_CORE=y
CONFIG_MFD_CROS_EC=y
CONFIG_MFD_CROS_EC_I2C=y
# CONFIG_MFD_ASIC3 is not set
CONFIG_PMIC_DA903X=y
# CONFIG_MFD_DA9052_I2C is not set
# CONFIG_MFD_DA9055 is not set
# CONFIG_MFD_DA9063 is not set
CONFIG_MFD_MC13XXX=y
CONFIG_MFD_MC13XXX_I2C=y
# CONFIG_HTC_EGPIO is not set
CONFIG_HTC_PASIC3=y
CONFIG_HTC_I2CPLD=y
# CONFIG_MFD_KEMPLD is not set
CONFIG_MFD_88PM800=y
CONFIG_MFD_88PM805=y
# CONFIG_MFD_88PM860X is not set
# CONFIG_MFD_MAX14577 is not set
# CONFIG_MFD_MAX77686 is not set
CONFIG_MFD_MAX77693=y
CONFIG_MFD_MAX8907=y
CONFIG_MFD_MAX8925=y
CONFIG_MFD_MAX8997=y
CONFIG_MFD_MAX8998=y
CONFIG_MFD_RETU=y
CONFIG_MFD_PCF50633=y
CONFIG_PCF50633_ADC=y
CONFIG_PCF50633_GPIO=y
CONFIG_MFD_PM8XXX=y
CONFIG_MFD_PM8921_CORE=y
CONFIG_MFD_RC5T583=y
CONFIG_MFD_SEC_CORE=y
CONFIG_MFD_SI476X_CORE=y
CONFIG_MFD_SM501=y
# CONFIG_MFD_SM501_GPIO is not set
# CONFIG_MFD_SMSC is not set
CONFIG_ABX500_CORE=y
# CONFIG_AB3100_CORE is not set
CONFIG_MFD_STMPE=y
#
# STMicroelectronics STMPE Interface Drivers
#
CONFIG_STMPE_I2C=y
CONFIG_MFD_SYSCON=y
CONFIG_MFD_TI_AM335X_TSCADC=y
# CONFIG_MFD_LP3943 is not set
CONFIG_MFD_LP8788=y
# CONFIG_MFD_PALMAS is not set
CONFIG_TPS6105X=y
CONFIG_TPS65010=y
CONFIG_TPS6507X=y
CONFIG_MFD_TPS65090=y
CONFIG_MFD_TPS65217=y
CONFIG_MFD_TPS65218=y
CONFIG_MFD_TPS6586X=y
# CONFIG_MFD_TPS65910 is not set
CONFIG_MFD_TPS65912=y
# CONFIG_MFD_TPS65912_I2C is not set
# CONFIG_MFD_TPS80031 is not set
CONFIG_TWL4030_CORE=y
CONFIG_TWL4030_MADC=y
# CONFIG_TWL4030_POWER is not set
CONFIG_MFD_TWL4030_AUDIO=y
# CONFIG_TWL6040_CORE is not set
CONFIG_MFD_WL1273_CORE=y
CONFIG_MFD_LM3533=y
CONFIG_MFD_TC3589X=y
CONFIG_MFD_TMIO=y
CONFIG_MFD_T7L66XB=y
CONFIG_MFD_TC6387XB=y
CONFIG_MFD_TC6393XB=y
CONFIG_MFD_ARIZONA=y
CONFIG_MFD_ARIZONA_I2C=y
# CONFIG_MFD_WM5102 is not set
# CONFIG_MFD_WM5110 is not set
# CONFIG_MFD_WM8997 is not set
CONFIG_MFD_WM8400=y
CONFIG_MFD_WM831X=y
CONFIG_MFD_WM831X_I2C=y
CONFIG_MFD_WM8350=y
CONFIG_MFD_WM8350_I2C=y
CONFIG_MFD_WM8994=y
# CONFIG_VEXPRESS_CONFIG is not set
CONFIG_REGULATOR=y
CONFIG_REGULATOR_DEBUG=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
CONFIG_REGULATOR_88PM800=y
CONFIG_REGULATOR_ACT8865=y
CONFIG_REGULATOR_AD5398=y
CONFIG_REGULATOR_ANATOP=y
CONFIG_REGULATOR_AAT2870=y
# CONFIG_REGULATOR_AS3722 is not set
CONFIG_REGULATOR_DA903X=y
CONFIG_REGULATOR_DA9210=y
# CONFIG_REGULATOR_FAN53555 is not set
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_ISL6271A=y
CONFIG_REGULATOR_LP3971=y
# CONFIG_REGULATOR_LP3972 is not set
# CONFIG_REGULATOR_LP872X is not set
CONFIG_REGULATOR_LP8755=y
CONFIG_REGULATOR_LP8788=y
CONFIG_REGULATOR_MAX1586=y
# CONFIG_REGULATOR_MAX8649 is not set
CONFIG_REGULATOR_MAX8660=y
# CONFIG_REGULATOR_MAX8907 is not set
CONFIG_REGULATOR_MAX8925=y
CONFIG_REGULATOR_MAX8952=y
# CONFIG_REGULATOR_MAX8973 is not set
CONFIG_REGULATOR_MAX8997=y
CONFIG_REGULATOR_MAX8998=y
# CONFIG_REGULATOR_MAX77693 is not set
CONFIG_REGULATOR_MC13XXX_CORE=y
CONFIG_REGULATOR_MC13783=y
# CONFIG_REGULATOR_MC13892 is not set
CONFIG_REGULATOR_PCF50633=y
# CONFIG_REGULATOR_PFUZE100 is not set
CONFIG_REGULATOR_RC5T583=y
CONFIG_REGULATOR_S2MPS11=y
CONFIG_REGULATOR_S5M8767=y
CONFIG_REGULATOR_TPS51632=y
# CONFIG_REGULATOR_TPS6105X is not set
CONFIG_REGULATOR_TPS62360=y
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
CONFIG_REGULATOR_TPS65090=y
# CONFIG_REGULATOR_TPS65217 is not set
CONFIG_REGULATOR_TPS65218=y
CONFIG_REGULATOR_TPS6586X=y
CONFIG_REGULATOR_TWL4030=y
CONFIG_REGULATOR_WM831X=y
CONFIG_REGULATOR_WM8350=y
CONFIG_REGULATOR_WM8400=y
CONFIG_REGULATOR_WM8994=y
# CONFIG_MEDIA_SUPPORT is not set
#
# Graphics support
#
#
# Direct Rendering Manager
#
#
# Frame buffer Devices
#
# CONFIG_FB is not set
# CONFIG_EXYNOS_VIDEO is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=y
# CONFIG_LCD_PLATFORM is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_GENERIC=y
CONFIG_BACKLIGHT_LM3533=y
CONFIG_BACKLIGHT_DA903X=y
CONFIG_BACKLIGHT_MAX8925=y
CONFIG_BACKLIGHT_WM831X=y
CONFIG_BACKLIGHT_ADP8860=y
CONFIG_BACKLIGHT_ADP8870=y
CONFIG_BACKLIGHT_PCF50633=y
CONFIG_BACKLIGHT_AAT2870=y
CONFIG_BACKLIGHT_LM3639=y
CONFIG_BACKLIGHT_PANDORA=y
CONFIG_BACKLIGHT_TPS65217=y
CONFIG_BACKLIGHT_GPIO=y
# CONFIG_BACKLIGHT_LV5207LP is not set
CONFIG_BACKLIGHT_BD6107=y
# CONFIG_VGASTATE is not set
CONFIG_VIDEO_OUTPUT_CONTROL=y
# CONFIG_SOUND is not set
#
# HID support
#
CONFIG_HID=y
# CONFIG_HID_BATTERY_STRENGTH is not set
# CONFIG_HIDRAW is not set
CONFIG_UHID=y
# CONFIG_HID_GENERIC is not set
#
# Special HID drivers
#
CONFIG_HID_A4TECH=y
# CONFIG_HID_ACRUX is not set
CONFIG_HID_APPLE=y
CONFIG_HID_AUREAL=y
# CONFIG_HID_BELKIN is not set
# CONFIG_HID_CHERRY is not set
CONFIG_HID_CHICONY=y
CONFIG_HID_CYPRESS=y
CONFIG_HID_DRAGONRISE=y
# CONFIG_DRAGONRISE_FF is not set
CONFIG_HID_EMS_FF=y
# CONFIG_HID_ELECOM is not set
CONFIG_HID_EZKEY=y
CONFIG_HID_KEYTOUCH=y
CONFIG_HID_KYE=y
# CONFIG_HID_UCLOGIC is not set
CONFIG_HID_WALTOP=y
# CONFIG_HID_GYRATION is not set
# CONFIG_HID_ICADE is not set
CONFIG_HID_TWINHAN=y
CONFIG_HID_KENSINGTON=y
CONFIG_HID_LCPOWER=y
# CONFIG_HID_LENOVO_TPKBD is not set
CONFIG_HID_LOGITECH=y
# CONFIG_LOGITECH_FF is not set
CONFIG_LOGIRUMBLEPAD2_FF=y
# CONFIG_LOGIG940_FF is not set
# CONFIG_LOGIWHEELS_FF is not set
CONFIG_HID_MAGICMOUSE=y
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
# CONFIG_HID_MULTITOUCH is not set
# CONFIG_HID_ORTEK is not set
# CONFIG_HID_PANTHERLORD is not set
CONFIG_HID_PETALYNX=y
CONFIG_HID_PICOLCD=y
# CONFIG_HID_PICOLCD_BACKLIGHT is not set
# CONFIG_HID_PICOLCD_LCD is not set
# CONFIG_HID_PICOLCD_LEDS is not set
CONFIG_HID_PRIMAX=y
CONFIG_HID_SAITEK=y
# CONFIG_HID_SAMSUNG is not set
# CONFIG_HID_SPEEDLINK is not set
CONFIG_HID_STEELSERIES=y
CONFIG_HID_SUNPLUS=y
CONFIG_HID_GREENASIA=y
# CONFIG_GREENASIA_FF is not set
CONFIG_HID_SMARTJOYPLUS=y
CONFIG_SMARTJOYPLUS_FF=y
CONFIG_HID_TIVO=y
CONFIG_HID_TOPSEED=y
CONFIG_HID_THINGM=y
CONFIG_HID_THRUSTMASTER=y
CONFIG_THRUSTMASTER_FF=y
# CONFIG_HID_WACOM is not set
CONFIG_HID_WIIMOTE=y
CONFIG_HID_XINMO=y
CONFIG_HID_ZEROPLUS=y
# CONFIG_ZEROPLUS_FF is not set
# CONFIG_HID_ZYDACRON is not set
CONFIG_HID_SENSOR_HUB=y
#
# I2C HID support
#
CONFIG_I2C_HID=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
# CONFIG_USB_SUPPORT is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_CLKGATE=y
#
# MMC/SD/SDIO Card Drivers
#
# CONFIG_MMC_BLOCK is not set
# CONFIG_SDIO_UART is not set
CONFIG_MMC_TEST=y
#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_ARMMMCI is not set
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_OF_ARASAN=y
CONFIG_MMC_SDHCI_PXAV3=y
# CONFIG_MMC_SDHCI_PXAV2 is not set
# CONFIG_MMC_TMIO is not set
# CONFIG_MMC_DW is not set
CONFIG_MEMSTICK=y
CONFIG_MEMSTICK_DEBUG=y
#
# MemoryStick drivers
#
CONFIG_MEMSTICK_UNSAFE_RESUME=y
CONFIG_MSPRO_BLOCK=y
# CONFIG_MS_BLOCK is not set
#
# MemoryStick Host Controller Drivers
#
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
#
# LED drivers
#
CONFIG_LEDS_LM3530=y
CONFIG_LEDS_LM3533=y
# CONFIG_LEDS_LM3642 is not set
# CONFIG_LEDS_PCA9532 is not set
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_LP3944=y
CONFIG_LEDS_LP55XX_COMMON=y
CONFIG_LEDS_LP5521=y
CONFIG_LEDS_LP5523=y
CONFIG_LEDS_LP5562=y
CONFIG_LEDS_LP8501=y
CONFIG_LEDS_LP8788=y
CONFIG_LEDS_PCA955X=y
CONFIG_LEDS_PCA963X=y
CONFIG_LEDS_PCA9685=y
CONFIG_LEDS_WM831X_STATUS=y
# CONFIG_LEDS_WM8350 is not set
CONFIG_LEDS_DA903X=y
CONFIG_LEDS_REGULATOR=y
# CONFIG_LEDS_BD2802 is not set
CONFIG_LEDS_LT3593=y
CONFIG_LEDS_MC13783=y
# CONFIG_LEDS_TCA6507 is not set
CONFIG_LEDS_MAX8997=y
# CONFIG_LEDS_LM355x is not set
CONFIG_LEDS_OT200=y
# CONFIG_LEDS_BLINKM is not set
#
# LED Triggers
#
# CONFIG_LEDS_TRIGGERS is not set
# CONFIG_ACCESSIBILITY is not set
CONFIG_EDAC=y
CONFIG_EDAC_LEGACY_SYSFS=y
CONFIG_EDAC_DEBUG=y
# CONFIG_EDAC_MM_EDAC is not set
CONFIG_RTC_LIB=y
# CONFIG_RTC_CLASS is not set
# CONFIG_DMADEVICES is not set
CONFIG_AUXDISPLAY=y
# CONFIG_VIRT_DRIVERS is not set
#
# Virtio drivers
#
# CONFIG_VIRTIO_MMIO is not set
#
# Microsoft Hyper-V guest support
#
# CONFIG_STAGING is not set
CONFIG_CLKDEV_LOOKUP=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y
#
# Common Clock Framework
#
CONFIG_COMMON_CLK_WM831X=y
CONFIG_COMMON_CLK_VERSATILE=y
# CONFIG_COMMON_CLK_SI5351 is not set
CONFIG_COMMON_CLK_SI570=y
# CONFIG_COMMON_CLK_S2MPS11 is not set
# CONFIG_COMMON_CLK_QCOM is not set
#
# Hardware Spinlock drivers
#
CONFIG_CLKSRC_MMIO=y
CONFIG_MAILBOX=y
# CONFIG_PL320_MBOX is not set
CONFIG_IOMMU_SUPPORT=y
CONFIG_OF_IOMMU=y
#
# Remoteproc drivers
#
# CONFIG_STE_MODEM_RPROC is not set
#
# Rpmsg drivers
#
# CONFIG_PM_DEVFREQ is not set
CONFIG_EXTCON=y
#
# Extcon Device Drivers
#
CONFIG_OF_EXTCON=y
CONFIG_EXTCON_GPIO=y
# CONFIG_EXTCON_ADC_JACK is not set
CONFIG_EXTCON_MAX77693=y
# CONFIG_EXTCON_MAX8997 is not set
# CONFIG_MEMORY is not set
CONFIG_IIO=y
CONFIG_IIO_BUFFER=y
# CONFIG_IIO_BUFFER_CB is not set
CONFIG_IIO_KFIFO_BUF=y
CONFIG_IIO_TRIGGERED_BUFFER=y
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
#
# Accelerometers
#
CONFIG_BMA180=y
CONFIG_HID_SENSOR_ACCEL_3D=y
CONFIG_IIO_ST_ACCEL_3AXIS=y
CONFIG_IIO_ST_ACCEL_I2C_3AXIS=y
#
# Analog to digital converters
#
CONFIG_EXYNOS_ADC=y
# CONFIG_LP8788_ADC is not set
# CONFIG_MAX1363 is not set
CONFIG_MCP3422=y
# CONFIG_NAU7802 is not set
# CONFIG_TI_ADC081C is not set
# CONFIG_TI_AM335X_ADC is not set
CONFIG_TWL6030_GPADC=y
# CONFIG_VF610_ADC is not set
#
# Amplifiers
#
#
# Hid Sensor IIO Common
#
CONFIG_HID_SENSOR_IIO_COMMON=y
CONFIG_HID_SENSOR_IIO_TRIGGER=y
CONFIG_IIO_ST_SENSORS_I2C=y
CONFIG_IIO_ST_SENSORS_CORE=y
#
# Digital to analog converters
#
CONFIG_AD5064=y
CONFIG_AD5380=y
CONFIG_AD5446=y
# CONFIG_MAX517 is not set
# CONFIG_MCP4725 is not set
#
# Frequency Synthesizers DDS/PLL
#
#
# Clock Generator/Distribution
#
#
# Phase-Locked Loop (PLL) frequency synthesizers
#
#
# Digital gyroscope sensors
#
CONFIG_HID_SENSOR_GYRO_3D=y
CONFIG_IIO_ST_GYRO_3AXIS=y
CONFIG_IIO_ST_GYRO_I2C_3AXIS=y
# CONFIG_ITG3200 is not set
#
# Humidity sensors
#
CONFIG_DHT11=y
# CONFIG_SI7005 is not set
#
# Inertial measurement units
#
# CONFIG_INV_MPU6050_IIO is not set
#
# Light sensors
#
CONFIG_ADJD_S311=y
CONFIG_APDS9300=y
CONFIG_CM32181=y
CONFIG_CM36651=y
CONFIG_GP2AP020A00F=y
# CONFIG_HID_SENSOR_ALS is not set
CONFIG_HID_SENSOR_PROX=y
CONFIG_SENSORS_LM3533=y
CONFIG_LTR501=y
CONFIG_TCS3472=y
CONFIG_SENSORS_TSL2563=y
CONFIG_TSL4531=y
# CONFIG_VCNL4000 is not set
#
# Magnetometer sensors
#
CONFIG_AK8975=y
CONFIG_MAG3110=y
# CONFIG_HID_SENSOR_MAGNETOMETER_3D is not set
# CONFIG_IIO_ST_MAGN_3AXIS is not set
#
# Inclinometer sensors
#
CONFIG_HID_SENSOR_INCLINOMETER_3D=y
#
# Triggers - standalone
#
CONFIG_IIO_INTERRUPT_TRIGGER=y
# CONFIG_IIO_SYSFS_TRIGGER is not set
#
# Pressure sensors
#
CONFIG_HID_SENSOR_PRESS=y
CONFIG_MPL3115=y
CONFIG_IIO_ST_PRESS=y
CONFIG_IIO_ST_PRESS_I2C=y
#
# Temperature sensors
#
CONFIG_TMP006=y
# CONFIG_PWM is not set
CONFIG_IRQCHIP=y
CONFIG_ARM_VIC=y
CONFIG_ARM_VIC_NR=2
CONFIG_VERSATILE_FPGA_IRQ=y
CONFIG_VERSATILE_FPGA_IRQ_NR=4
# CONFIG_IPACK_BUS is not set
# CONFIG_RESET_CONTROLLER is not set
CONFIG_FMC=y
CONFIG_FMC_FAKEDEV=y
CONFIG_FMC_TRIVIAL=y
CONFIG_FMC_WRITE_EEPROM=y
CONFIG_FMC_CHARDEV=y
#
# PHY Subsystem
#
CONFIG_GENERIC_PHY=y
# CONFIG_PHY_EXYNOS_MIPI_VIDEO is not set
CONFIG_PHY_EXYNOS_DP_VIDEO=y
# CONFIG_BCM_KONA_USB2_PHY is not set
# CONFIG_POWERCAP is not set
CONFIG_MCB=y
#
# File systems
#
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
# CONFIG_EXT3_FS_SECURITY is not set
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
CONFIG_XFS_FS=y
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
# CONFIG_XFS_RT is not set
CONFIG_XFS_DEBUG=y
CONFIG_GFS2_FS=y
CONFIG_BTRFS_FS=y
# CONFIG_BTRFS_FS_POSIX_ACL is not set
CONFIG_BTRFS_FS_CHECK_INTEGRITY=y
CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y
# CONFIG_BTRFS_DEBUG is not set
CONFIG_BTRFS_ASSERT=y
# CONFIG_NILFS2_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
# CONFIG_INOTIFY_USER is not set
# CONFIG_FANOTIFY is not set
# CONFIG_QUOTA is not set
CONFIG_QUOTACTL=y
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set
#
# Caches
#
CONFIG_FSCACHE=y
CONFIG_FSCACHE_DEBUG=y
# CONFIG_CACHEFILES is not set
#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=y
CONFIG_UDF_NLS=y
#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
# CONFIG_MSDOS_FS is not set
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set
#
# Pseudo filesystems
#
# CONFIG_PROC_FS is not set
CONFIG_KERNFS=y
CONFIG_SYSFS=y
# CONFIG_HUGETLB_PAGE is not set
CONFIG_CONFIGFS_FS=y
# CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_852=y
CONFIG_NLS_CODEPAGE_855=y
CONFIG_NLS_CODEPAGE_857=y
CONFIG_NLS_CODEPAGE_860=y
# CONFIG_NLS_CODEPAGE_861 is not set
CONFIG_NLS_CODEPAGE_862=y
# CONFIG_NLS_CODEPAGE_863 is not set
CONFIG_NLS_CODEPAGE_864=y
CONFIG_NLS_CODEPAGE_865=y
# CONFIG_NLS_CODEPAGE_866 is not set
CONFIG_NLS_CODEPAGE_869=y
# CONFIG_NLS_CODEPAGE_936 is not set
CONFIG_NLS_CODEPAGE_950=y
CONFIG_NLS_CODEPAGE_932=y
# CONFIG_NLS_CODEPAGE_949 is not set
CONFIG_NLS_CODEPAGE_874=y
CONFIG_NLS_ISO8859_8=y
CONFIG_NLS_CODEPAGE_1250=y
CONFIG_NLS_CODEPAGE_1251=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
CONFIG_NLS_ISO8859_4=y
CONFIG_NLS_ISO8859_5=y
CONFIG_NLS_ISO8859_6=y
CONFIG_NLS_ISO8859_7=y
CONFIG_NLS_ISO8859_9=y
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
CONFIG_NLS_KOI8_R=y
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_MAC_ROMAN is not set
CONFIG_NLS_MAC_CELTIC=y
# CONFIG_NLS_MAC_CENTEURO is not set
CONFIG_NLS_MAC_CROATIAN=y
# CONFIG_NLS_MAC_CYRILLIC is not set
CONFIG_NLS_MAC_GAELIC=y
CONFIG_NLS_MAC_GREEK=y
# CONFIG_NLS_MAC_ICELAND is not set
CONFIG_NLS_MAC_INUIT=y
CONFIG_NLS_MAC_ROMANIAN=y
# CONFIG_NLS_MAC_TURKISH is not set
# CONFIG_NLS_UTF8 is not set
#
# Kernel hacking
#
#
# printk and dmesg options
#
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
#
# Compile-time checks and compiler options
#
CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_INFO_REDUCED is not set
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=1024
CONFIG_STRIP_ASM_SYMS=y
CONFIG_READABLE_ASM=y
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
CONFIG_DEBUG_KERNEL=y
#
# Memory Debugging
#
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_WANT_PAGE_DEBUG_FLAGS=y
CONFIG_PAGE_POISONING=y
# CONFIG_DEBUG_OBJECTS is not set
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=400
# CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF is not set
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_DEBUG_VM=y
# CONFIG_DEBUG_VM_RB is not set
CONFIG_DEBUG_NOMMU_REGIONS=y
CONFIG_DEBUG_MEMORY_INIT=y
# CONFIG_DEBUG_SHIRQ is not set
#
# Debug Lockups and Hangs
#
CONFIG_LOCKUP_DETECTOR=y
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=1
# CONFIG_DETECT_HUNG_TASK is not set
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_ON_OOPS_VALUE=1
CONFIG_PANIC_TIMEOUT=0
#
# Lock Debugging (spinlocks, mutexes, etc...)
#
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=y
CONFIG_LOCKDEP=y
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_LOCKDEP is not set
# CONFIG_DEBUG_ATOMIC_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_LOCK_TORTURE_TEST=y
CONFIG_TRACE_IRQFLAGS=y
CONFIG_STACKTRACE=y
CONFIG_DEBUG_KOBJECT=y
CONFIG_DEBUG_WRITECOUNT=y
# CONFIG_DEBUG_LIST is not set
CONFIG_DEBUG_SG=y
# CONFIG_DEBUG_NOTIFIERS is not set
CONFIG_DEBUG_CREDENTIALS=y
#
# RCU Debugging
#
CONFIG_PROVE_RCU=y
CONFIG_PROVE_RCU_REPEATEDLY=y
# CONFIG_SPARSE_RCU_POINTER is not set
CONFIG_TORTURE_TEST=y
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
CONFIG_FAULT_INJECTION=y
CONFIG_FAIL_PAGE_ALLOC=y
# CONFIG_FAIL_MAKE_REQUEST is not set
# CONFIG_FAIL_IO_TIMEOUT is not set
# CONFIG_FAIL_MMC_REQUEST is not set
# CONFIG_FAULT_INJECTION_DEBUG_FS is not set
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
#
# Runtime Testing
#
CONFIG_LKDTM=y
# CONFIG_TEST_LIST_SORT is not set
CONFIG_BACKTRACE_SELF_TEST=y
# CONFIG_RBTREE_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_KSTRTOX is not set
CONFIG_DMA_API_DEBUG=y
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_ARM_UNWIND=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_LL is not set
CONFIG_DEBUG_LL_INCLUDE="debug/pl01x.S"
CONFIG_DEBUG_UART_PL01X=y
# CONFIG_DEBUG_UART_8250 is not set
CONFIG_DEBUG_UART_PHYS=0x16000000
CONFIG_DEBUG_UART_VIRT=0xf1600000
CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h"
# CONFIG_OC_ETM is not set
#
# Security options
#
CONFIG_KEYS=y
# CONFIG_PERSISTENT_KEYRINGS is not set
CONFIG_ENCRYPTED_KEYS=y
CONFIG_KEYS_DEBUG_PROC_KEYS=y
CONFIG_SECURITY_DMESG_RESTRICT=y
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
# CONFIG_SECURITY_PATH is not set
# CONFIG_SECURITY_YAMA is not set
# CONFIG_IMA is not set
# CONFIG_EVM is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_XOR_BLOCKS=y
CONFIG_CRYPTO=y
#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=y
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=y
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=y
CONFIG_CRYPTO_AUTHENC=y
#
# Authenticated Encryption with Associated Data
#
CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_SEQIV=y
#
# Block modes
#
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=y
# CONFIG_CRYPTO_ECB is not set
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_PCBC is not set
# CONFIG_CRYPTO_XTS is not set
#
# Hash modes
#
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_XCBC=y
# CONFIG_CRYPTO_VMAC is not set
#
# Digest
#
CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_CRC32=y
CONFIG_CRYPTO_CRCT10DIF=y
CONFIG_CRYPTO_GHASH=y
CONFIG_CRYPTO_MD4=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=y
# CONFIG_CRYPTO_RMD128 is not set
CONFIG_CRYPTO_RMD160=y
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA1_ARM=y
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
CONFIG_CRYPTO_TGR192=y
CONFIG_CRYPTO_WP512=y
#
# Ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_ARM=y
CONFIG_CRYPTO_ANUBIS=y
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_BLOWFISH=y
CONFIG_CRYPTO_BLOWFISH_COMMON=y
CONFIG_CRYPTO_CAMELLIA=y
CONFIG_CRYPTO_CAST_COMMON=y
CONFIG_CRYPTO_CAST5=y
# CONFIG_CRYPTO_CAST6 is not set
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_FCRYPT=y
CONFIG_CRYPTO_KHAZAD=y
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
CONFIG_CRYPTO_TEA=y
# CONFIG_CRYPTO_TWOFISH is not set
#
# Compression
#
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_ZLIB=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_LZ4=y
CONFIG_CRYPTO_LZ4HC=y
#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_HASH_INFO=y
# CONFIG_CRYPTO_HW is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_PUBLIC_KEY_ALGO_RSA=y
CONFIG_X509_CERTIFICATE_PARSER=y
# CONFIG_BINARY_PRINTF is not set
#
# Library routines
#
CONFIG_RAID6_PQ=y
CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IO=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_CRC_CCITT=y
CONFIG_CRC16=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC32=y
CONFIG_CRC32_SELFTEST=y
# CONFIG_CRC32_SLICEBY8 is not set
# CONFIG_CRC32_SLICEBY4 is not set
CONFIG_CRC32_SARWATE=y
# CONFIG_CRC32_BIT is not set
CONFIG_CRC7=y
CONFIG_LIBCRC32C=y
CONFIG_CRC8=y
CONFIG_CRC64_ECMA=y
# CONFIG_RANDOM32_SELFTEST is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_LZ4_COMPRESS=y
CONFIG_LZ4HC_COMPRESS=y
CONFIG_LZ4_DECOMPRESS=y
CONFIG_XZ_DEC=y
# CONFIG_XZ_DEC_X86 is not set
# CONFIG_XZ_DEC_POWERPC is not set
CONFIG_XZ_DEC_IA64=y
CONFIG_XZ_DEC_ARM=y
# CONFIG_XZ_DEC_ARMTHUMB is not set
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_ASSOCIATIVE_ARRAY=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HAS_DMA=y
CONFIG_NLATTR=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_AVERAGE=y
CONFIG_CLZ_TAB=y
CONFIG_CORDIC=y
# CONFIG_DDR is not set
CONFIG_MPILIB=y
CONFIG_OID_REGISTRY=y
CONFIG_VIRTUALIZATION=y
^ permalink raw reply
* Re: Suspending access to opened/active /dev/nodes during application runtime
From: David Herrmann @ 2014-03-11 12:33 UTC (permalink / raw)
To: Lukasz Pawelczyk
Cc: libvir-list, systemd Mailing List, linux-kernel, lxc-devel,
open list:HID CORE LAYER
In-Reply-To: <9D7BA6C9-9F1F-4D09-8F4F-E7DA4720FF97@gmail.com>
Hi
On Fri, Mar 7, 2014 at 7:45 PM, Lukasz Pawelczyk <havner@gmail.com> wrote:
> Problem:
> Has anyone thought about a mechanism to limit/remove an access to a
> device during an application runtime? Meaning we have an application
> that has an open file descriptor to some /dev/node and depending on
> *something* it gains or looses the access to it gracefully (with or
> without a notification, but without any fatal consequences).
>
> Example:
> LXC. Imagine we have 2 separate containers. Both running full operating
> systems. Specifically with 2 X servers. Both running concurrently of
> course. Both need the same input devices (e.g. we have just one mouse).
> This creates a security problem when we want to have completely separate
> environments. One container is active (being displayed on a monitor and
> controlled with a mouse) while the other container runs evtest
> /dev/input/something and grabs the secret password user typed in the
> other.
>
> Solutions:
> The complete solution would comprise of 2 parts:
> - a mechanism that would allow to temporally "hide" a device from an
> open file descriptor.
> - a mechanism for deciding whether application/process/namespace should
> have an access to a specific device at a specific moment
>
> Let's focus on the first problem only, as it would need to be solved
> first anyway. I haven't found anything that would allow me to do
> it. There are a lot mechanisms that make it possible to restrict an
> access during open():
> - DAC
> - ACL (controlled by hand or with uaccess)
> - LSM (in general)
> - device cgroups
> But all of those can't do a thing when the device is already opened and
> an application has a file descriptor. I don't see such mechanism in
> kernel sources either.
>
> I do imagine that it would not be possible for every device to handle
> such a thing (dri comes to mind) without breaking something (graphics
> card state in dri example). But there is class of simple input/output
> devices that would handle this without problems.
>
> I did implement some proof-of-concept solution for an evdev driver by
> allowing or disallowing events that go to evdev_client structure using
> some arbitrary condition. But this is far from a generic solution.
>
> My proof-of-concept is somewhat similar to this (I just found it):
> http://www.spinics.net/lists/linux-input/msg25547.html
> Though a little bit wider in scope. But neither is flawless nor
> generic.
>
> Has anyone had any thoughts about a similar problem?
Lennart and Greg have already answered most of this, few notes from me:
* EVIOCREVOKE and DRM_SET_MASTER/DROP_MASTER are real. We use them.
They solve your problem for gfx and input devices.
* EVIOCMUTE is *bad*. It is a privileged ioctl compared to
EVIOCREVOKE, so we've never merged it. It neither has major advantages
over revoke. So use EVIOCREVOKE.
* A generic frevoke() syscall would solve all is, but is unlikely to
ever appear upstream.
Cheers
David
^ permalink raw reply
* Re: Qualcomm PMIC8XXX keypad never worked?
From: Lee Jones @ 2014-03-11 13:06 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Trilok Soni, Samuel Ortiz, Dmitry Torokhov, Stephen Boyd,
linux-kernel, Anirudh Ghayal, linux-input, linux-arm-kernel
In-Reply-To: <8206209.oc1V5pPVYT@wuerfel>
> > > Something in the MFD_PM8XXX driver must have changed recently that now allows
> > > the KEYBOARD_PMIC8XXX driver to be enabled. Unfortunately, it does not build
> > > because of a dependency on the <linux/mfd/pm8xxx/gpio.h> header file that
> > > does not exist.
> >
> > I have it?
> >
> > -rw-r--r-- 1 lee lee 2147 Dec 18 11:52 include/linux/mfd/pm8xxx/core.h
>
> This is core.h, not gpio.h
Hmmm... so it is. I think I'm going senile!
> > > In order to keep 'make randconfig' working on my test box, I have disabled
> > > this driver, but it would be nice of someone could have a look into fixing it.
> >
> > Can you send me the config that breaks please?
>
> appended below. You might need more patches to build this, but you will get the
> error if you just try building the input driver.
Okay, I've recreated the error.
I think it's this commit that's causing your error:
https://lkml.org/lkml/2013/12/10/903
... but the MFD isn't broken, so I guess your solution is the most
elegant. If it's not fixed soon, I guess we should think about ripping
it out. It's obvoious that no-one cares, as it's been broken for
nearly 3 years.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: Qualcomm PMIC8xxx keypad never worked?
From: Josh Cartwright @ 2014-03-11 13:20 UTC (permalink / raw)
To: Lee Jones
Cc: Arnd Bergmann, Trilok Soni, Samuel Ortiz, Dmitry Torokhov,
Stephen Boyd, linux-kernel, Anirudh Ghayal, linux-input,
linux-arm-kernel
In-Reply-To: <20140311130609.GL21216@lee--X1>
On Tue, Mar 11, 2014 at 01:06:09PM +0000, Lee Jones wrote:
> > > > Something in the MFD_PM8XXX driver must have changed recently that now allows
> > > > the KEYBOARD_PMIC8XXX driver to be enabled. Unfortunately, it does not build
> > > > because of a dependency on the <linux/mfd/pm8xxx/gpio.h> header file that
> > > > does not exist.
>
> I think it's this commit that's causing your error:
>
> https://lkml.org/lkml/2013/12/10/903
>
> ... but the MFD isn't broken, so I guess your solution is the most
> elegant. If it's not fixed soon, I guess we should think about ripping
> it out. It's obvoious that no-one cares, as it's been broken for
> nearly 3 years.
Stephen has a pending patchset to cleanup and actually make the pm8xxx
input drivers work, but they have not been picked up yet:
http://lkml.kernel.org/r/1393958088-1456-1-git-send-email-sboyd@codeaurora.org
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply
* Re: Qualcomm PMIC8xxx keypad never worked?
From: Lee Jones @ 2014-03-11 13:35 UTC (permalink / raw)
To: Josh Cartwright
Cc: Arnd Bergmann, Trilok Soni, Samuel Ortiz, Dmitry Torokhov,
Stephen Boyd, linux-kernel, Anirudh Ghayal, linux-input,
linux-arm-kernel
In-Reply-To: <20140311132013.GO18529@joshc.qualcomm.com>
> > > > > Something in the MFD_PM8XXX driver must have changed recently that now allows
> > > > > the KEYBOARD_PMIC8XXX driver to be enabled. Unfortunately, it does not build
> > > > > because of a dependency on the <linux/mfd/pm8xxx/gpio.h> header file that
> > > > > does not exist.
> >
> > I think it's this commit that's causing your error:
> >
> > https://lkml.org/lkml/2013/12/10/903
> >
> > ... but the MFD isn't broken, so I guess your solution is the most
> > elegant. If it's not fixed soon, I guess we should think about ripping
> > it out. It's obvoious that no-one cares, as it's been broken for
> > nearly 3 years.
>
> Stephen has a pending patchset to cleanup and actually make the pm8xxx
> input drivers work, but they have not been picked up yet:
>
> http://lkml.kernel.org/r/1393958088-1456-1-git-send-email-sboyd@codeaurora.org
Ideal. Thanks for letting us know.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] Input: wistron_btns - simplify dependencies
From: Jean Delvare @ 2014-03-11 13:36 UTC (permalink / raw)
To: linux-input; +Cc: Miloslav Trmac, Dmitry Torokhov
Kconfig symbol X86_32 was introduced in October 2005, it's about time
to use it. This clears the last occurrence of the legacy
"X86 && !X86_64" construct :-)
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Miloslav Trmac <mitr@volny.cz>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/misc/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-3.14-rc6.orig/drivers/input/misc/Kconfig 2014-02-09 16:53:02.902633206 +0100
+++ linux-3.14-rc6/drivers/input/misc/Kconfig 2014-03-11 14:31:38.112813328 +0100
@@ -269,7 +269,7 @@ config INPUT_COBALT_BTNS
config INPUT_WISTRON_BTNS
tristate "x86 Wistron laptop button interface"
- depends on X86 && !X86_64
+ depends on X86_32
select INPUT_POLLDEV
select INPUT_SPARSEKMAP
select NEW_LEDS
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply
* [PATCH 1/3] mfd: max8997: use regmap to access registers
From: Robert Baldyga @ 2014-03-11 13:58 UTC (permalink / raw)
To: sameo, lee.jones
Cc: myungjoo.ham, cw00.choi, dmitry.torokhov, cooloney, rpurdie,
dbaryshkov, dwmw2, lgirdwood, broonie, a.zummo, paul.gortmaker,
linux-kernel, linux-input, linux-leds, rtc-linux, m.szyprowski,
k.kozlowski, Robert Baldyga
In-Reply-To: <1394546304-15191-1-git-send-email-r.baldyga@samsung.com>
This patch modifies max8997 driver and each associated function driver,
to use regmap instead of operating directly on i2c bus. It will allow to
simplify IRQ handling using regmap-irq.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
drivers/extcon/extcon-max8997.c | 31 ++++----
drivers/input/misc/max8997_haptic.c | 34 +++++----
drivers/leds/leds-max8997.c | 13 ++--
drivers/mfd/max8997-irq.c | 64 ++++++----------
drivers/mfd/max8997.c | 143 ++++++++++++++++-------------------
drivers/power/max8997_charger.c | 33 ++++----
drivers/regulator/max8997.c | 87 ++++++++++-----------
drivers/rtc/rtc-max8997.c | 56 ++++++++------
include/linux/mfd/max8997-private.h | 17 ++---
9 files changed, 229 insertions(+), 249 deletions(-)
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 6a00464..f258c08 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -27,6 +27,7 @@
#include <linux/mfd/max8997-private.h>
#include <linux/extcon.h>
#include <linux/irqdomain.h>
+#include <linux/regmap.h>
#define DEV_NAME "max8997-muic"
#define DELAY_MS_DEFAULT 20000 /* unit: millisecond */
@@ -116,7 +117,7 @@ enum max8997_muic_charger_type {
struct max8997_muic_info {
struct device *dev;
- struct i2c_client *muic;
+ struct max8997_dev *max8997;
struct extcon_dev *edev;
int prev_cable_type;
int prev_chg_type;
@@ -190,10 +191,10 @@ static int max8997_muic_set_debounce_time(struct max8997_muic_info *info,
case ADC_DEBOUNCE_TIME_10MS:
case ADC_DEBOUNCE_TIME_25MS:
case ADC_DEBOUNCE_TIME_38_62MS:
- ret = max8997_update_reg(info->muic,
+ ret = regmap_update_bits(info->max8997->regmap_muic,
MAX8997_MUIC_REG_CONTROL3,
- time << CONTROL3_ADCDBSET_SHIFT,
- CONTROL3_ADCDBSET_MASK);
+ CONTROL3_ADCDBSET_MASK,
+ time << CONTROL3_ADCDBSET_SHIFT);
if (ret) {
dev_err(info->dev, "failed to set ADC debounce time\n");
return ret;
@@ -228,8 +229,8 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
else
ctrl1 = CONTROL1_SW_OPEN;
- ret = max8997_update_reg(info->muic,
- MAX8997_MUIC_REG_CONTROL1, ctrl1, COMP_SW_MASK);
+ ret = regmap_update_bits(info->max8997->regmap_muic,
+ MAX8997_MUIC_REG_CONTROL1, COMP_SW_MASK, ctrl1);
if (ret < 0) {
dev_err(info->dev, "failed to update MUIC register\n");
return ret;
@@ -240,9 +241,9 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
else
ctrl2 |= CONTROL2_LOWPWR_MASK; /* LowPwr=1, CPEn=0 */
- ret = max8997_update_reg(info->muic,
- MAX8997_MUIC_REG_CONTROL2, ctrl2,
- CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK);
+ ret = regmap_update_bits(info->max8997->regmap_muic,
+ MAX8997_MUIC_REG_CONTROL2,
+ CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK, ctrl2);
if (ret < 0) {
dev_err(info->dev, "failed to update MUIC register\n");
return ret;
@@ -543,8 +544,8 @@ static void max8997_muic_irq_work(struct work_struct *work)
if (info->irq == muic_irqs[i].virq)
irq_type = muic_irqs[i].irq;
- ret = max8997_bulk_read(info->muic, MAX8997_MUIC_REG_STATUS1,
- 2, info->status);
+ ret = regmap_bulk_read(info->max8997->regmap_muic,
+ MAX8997_MUIC_REG_STATUS1, info->status, 2);
if (ret) {
dev_err(info->dev, "failed to read muic register\n");
mutex_unlock(&info->mutex);
@@ -605,8 +606,8 @@ static int max8997_muic_detect_dev(struct max8997_muic_info *info)
mutex_lock(&info->mutex);
/* Read STATUSx register to detect accessory */
- ret = max8997_bulk_read(info->muic,
- MAX8997_MUIC_REG_STATUS1, 2, info->status);
+ ret = regmap_bulk_read(info->max8997->regmap_muic,
+ MAX8997_MUIC_REG_STATUS1, info->status, 2);
if (ret) {
dev_err(info->dev, "failed to read MUIC register\n");
mutex_unlock(&info->mutex);
@@ -667,7 +668,7 @@ static int max8997_muic_probe(struct platform_device *pdev)
}
info->dev = &pdev->dev;
- info->muic = max8997->muic;
+ info->max8997 = max8997;
platform_set_drvdata(pdev, info);
mutex_init(&info->mutex);
@@ -721,7 +722,7 @@ static int max8997_muic_probe(struct platform_device *pdev)
/* Initialize registers according to platform data */
for (i = 0; i < muic_pdata->num_init_data; i++) {
- max8997_write_reg(info->muic,
+ regmap_write(info->max8997->regmap_muic,
muic_pdata->init_data[i].addr,
muic_pdata->init_data[i].data);
}
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index 1fea548..d3f7079 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -31,6 +31,7 @@
#include <linux/mfd/max8997-private.h>
#include <linux/mfd/max8997.h>
#include <linux/regulator/consumer.h>
+#include <linux/regmap.h>
/* Haptic configuration 2 register */
#define MAX8997_MOTOR_TYPE_SHIFT 7
@@ -45,7 +46,7 @@
struct max8997_haptic {
struct device *dev;
- struct i2c_client *client;
+ struct max8997_dev *max8997;
struct input_dev *input_dev;
struct regulator *regulator;
@@ -86,19 +87,19 @@ static int max8997_haptic_set_duty_cycle(struct max8997_haptic *chip)
}
switch (chip->internal_mode_pattern) {
case 0:
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_SIGPWMDC1, duty_index);
break;
case 1:
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_SIGPWMDC2, duty_index);
break;
case 2:
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_SIGPWMDC3, duty_index);
break;
case 3:
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_SIGPWMDC4, duty_index);
break;
default:
@@ -115,50 +116,51 @@ static void max8997_haptic_configure(struct max8997_haptic *chip)
value = chip->type << MAX8997_MOTOR_TYPE_SHIFT |
chip->enabled << MAX8997_ENABLE_SHIFT |
chip->mode << MAX8997_MODE_SHIFT | chip->pwm_divisor;
- max8997_write_reg(chip->client, MAX8997_HAPTIC_REG_CONF2, value);
+ regmap_write(chip->max8997->regmap_haptic,
+ MAX8997_HAPTIC_REG_CONF2, value);
if (chip->mode == MAX8997_INTERNAL_MODE && chip->enabled) {
value = chip->internal_mode_pattern << MAX8997_CYCLE_SHIFT |
chip->internal_mode_pattern << MAX8997_SIG_PERIOD_SHIFT |
chip->internal_mode_pattern << MAX8997_SIG_DUTY_SHIFT |
chip->internal_mode_pattern << MAX8997_PWM_DUTY_SHIFT;
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_DRVCONF, value);
switch (chip->internal_mode_pattern) {
case 0:
value = chip->pattern_cycle << 4;
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_CYCLECONF1, value);
value = chip->pattern_signal_period;
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_SIGCONF1, value);
break;
case 1:
value = chip->pattern_cycle;
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_CYCLECONF1, value);
value = chip->pattern_signal_period;
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_SIGCONF2, value);
break;
case 2:
value = chip->pattern_cycle << 4;
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_CYCLECONF2, value);
value = chip->pattern_signal_period;
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_SIGCONF3, value);
break;
case 3:
value = chip->pattern_cycle;
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_CYCLECONF2, value);
value = chip->pattern_signal_period;
- max8997_write_reg(chip->client,
+ regmap_write(chip->max8997->regmap_haptic,
MAX8997_HAPTIC_REG_SIGCONF4, value);
break;
@@ -267,7 +269,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
INIT_WORK(&chip->work, max8997_haptic_play_effect_work);
mutex_init(&chip->mutex);
- chip->client = iodev->haptic;
+ chip->max8997 = iodev;
chip->dev = &pdev->dev;
chip->input_dev = input_dev;
chip->pwm_period = haptic_pdata->pwm_period;
diff --git a/drivers/leds/leds-max8997.c b/drivers/leds/leds-max8997.c
index f449a8b..e2da8f2 100644
--- a/drivers/leds/leds-max8997.c
+++ b/drivers/leds/leds-max8997.c
@@ -18,6 +18,7 @@
#include <linux/mfd/max8997.h>
#include <linux/mfd/max8997-private.h>
#include <linux/platform_device.h>
+#include <linux/regmap.h>
#define MAX8997_LED_FLASH_SHIFT 3
#define MAX8997_LED_FLASH_CUR_MASK 0xf8
@@ -53,7 +54,6 @@ static void max8997_led_set_mode(struct max8997_led *led,
enum max8997_led_mode mode)
{
int ret;
- struct i2c_client *client = led->iodev->i2c;
u8 mask = 0, val;
switch (mode) {
@@ -89,8 +89,8 @@ static void max8997_led_set_mode(struct max8997_led *led,
}
if (mask) {
- ret = max8997_update_reg(client, MAX8997_REG_LEN_CNTL, val,
- mask);
+ ret = regmap_update_bits(led->iodev->regmap,
+ MAX8997_REG_LEN_CNTL, mask, val);
if (ret)
dev_err(led->iodev->dev,
"failed to update register(%d)\n", ret);
@@ -102,7 +102,6 @@ static void max8997_led_set_mode(struct max8997_led *led,
static void max8997_led_enable(struct max8997_led *led, bool enable)
{
int ret;
- struct i2c_client *client = led->iodev->i2c;
u8 val = 0, mask = MAX8997_LED_BOOST_ENABLE_MASK;
if (led->enabled == enable)
@@ -110,7 +109,8 @@ static void max8997_led_enable(struct max8997_led *led, bool enable)
val = enable ? MAX8997_LED_BOOST_ENABLE_MASK : 0;
- ret = max8997_update_reg(client, MAX8997_REG_BOOST_CNTL, val, mask);
+ ret = regmap_update_bits(led->iodev->regmap,
+ MAX8997_REG_BOOST_CNTL, mask, val);
if (ret)
dev_err(led->iodev->dev,
"failed to update register(%d)\n", ret);
@@ -122,7 +122,6 @@ static void max8997_led_set_current(struct max8997_led *led,
enum led_brightness value)
{
int ret;
- struct i2c_client *client = led->iodev->i2c;
u8 val = 0, mask = 0, reg = 0;
switch (led->led_mode) {
@@ -143,7 +142,7 @@ static void max8997_led_set_current(struct max8997_led *led,
}
if (mask) {
- ret = max8997_update_reg(client, reg, val, mask);
+ ret = regmap_update_bits(led->iodev->regmap, reg, mask, val);
if (ret)
dev_err(led->iodev->dev,
"failed to update register(%d)\n", ret);
diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
index 43fa614..656d03b 100644
--- a/drivers/mfd/max8997-irq.c
+++ b/drivers/mfd/max8997-irq.c
@@ -26,6 +26,7 @@
#include <linux/interrupt.h>
#include <linux/mfd/max8997.h>
#include <linux/mfd/max8997-private.h>
+#include <linux/regmap.h>
static const u8 max8997_mask_reg[] = {
[PMIC_INT1] = MAX8997_REG_INT1MSK,
@@ -41,25 +42,6 @@ static const u8 max8997_mask_reg[] = {
[FLASH_STATUS] = MAX8997_REG_INVALID,
};
-static struct i2c_client *get_i2c(struct max8997_dev *max8997,
- enum max8997_irq_source src)
-{
- switch (src) {
- case PMIC_INT1 ... PMIC_INT4:
- return max8997->i2c;
- case FUEL_GAUGE:
- return NULL;
- case MUIC_INT1 ... MUIC_INT3:
- return max8997->muic;
- case GPIO_LOW ... GPIO_HI:
- return max8997->i2c;
- case FLASH_STATUS:
- return max8997->i2c;
- default:
- return ERR_PTR(-EINVAL);
- }
-}
-
struct max8997_irq_data {
int mask;
enum max8997_irq_source group;
@@ -124,15 +106,20 @@ static void max8997_irq_sync_unlock(struct irq_data *data)
int i;
for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
+ struct regmap *map;
u8 mask_reg = max8997_mask_reg[i];
- struct i2c_client *i2c = get_i2c(max8997, i);
+
+ if (i >= MUIC_INT1 && i <= MUIC_INT3)
+ map = max8997->regmap_muic;
+ else
+ map = max8997->regmap;
if (mask_reg == MAX8997_REG_INVALID ||
- IS_ERR_OR_NULL(i2c))
+ IS_ERR_OR_NULL(map))
continue;
max8997->irq_masks_cache[i] = max8997->irq_masks_cur[i];
- max8997_write_reg(i2c, max8997_mask_reg[i],
+ regmap_write(map, max8997_mask_reg[i],
max8997->irq_masks_cur[i]);
}
@@ -180,12 +167,12 @@ static struct irq_chip max8997_irq_chip = {
static irqreturn_t max8997_irq_thread(int irq, void *data)
{
struct max8997_dev *max8997 = data;
- u8 irq_reg[MAX8997_IRQ_GROUP_NR] = {};
- u8 irq_src;
+ unsigned int irq_reg[MAX8997_IRQ_GROUP_NR] = {};
+ unsigned int irq_src;
int ret;
int i, cur_irq;
- ret = max8997_read_reg(max8997->i2c, MAX8997_REG_INTSRC, &irq_src);
+ ret = regmap_read(max8997->regmap, MAX8997_REG_INTSRC, &irq_src);
if (ret < 0) {
dev_err(max8997->dev, "Failed to read interrupt source: %d\n",
ret);
@@ -194,8 +181,9 @@ static irqreturn_t max8997_irq_thread(int irq, void *data)
if (irq_src & MAX8997_IRQSRC_PMIC) {
/* PMIC INT1 ~ INT4 */
- max8997_bulk_read(max8997->i2c, MAX8997_REG_INT1, 4,
- &irq_reg[PMIC_INT1]);
+ for (i = 0; i < 4; ++i)
+ regmap_read(max8997->regmap,
+ MAX8997_REG_INT1+i, &irq_reg[PMIC_INT1+i]);
}
if (irq_src & MAX8997_IRQSRC_FUELGAUGE) {
/*
@@ -215,8 +203,9 @@ static irqreturn_t max8997_irq_thread(int irq, void *data)
}
if (irq_src & MAX8997_IRQSRC_MUIC) {
/* MUIC INT1 ~ INT3 */
- max8997_bulk_read(max8997->muic, MAX8997_MUIC_REG_INT1, 3,
- &irq_reg[MUIC_INT1]);
+ for (i = 0; i < 3; ++i)
+ regmap_read(max8997->regmap_muic,
+ MAX8997_MUIC_REG_INT1+i, &irq_reg[MUIC_INT1+i]);
}
if (irq_src & MAX8997_IRQSRC_GPIO) {
/* GPIO Interrupt */
@@ -225,8 +214,8 @@ static irqreturn_t max8997_irq_thread(int irq, void *data)
irq_reg[GPIO_LOW] = 0;
irq_reg[GPIO_HI] = 0;
- max8997_bulk_read(max8997->i2c, MAX8997_REG_GPIOCNTL1,
- MAX8997_NUM_GPIO, gpio_info);
+ regmap_bulk_read(max8997->regmap, MAX8997_REG_GPIOCNTL1,
+ gpio_info, MAX8997_NUM_GPIO);
for (i = 0; i < MAX8997_NUM_GPIO; i++) {
bool interrupt = false;
@@ -260,7 +249,7 @@ static irqreturn_t max8997_irq_thread(int irq, void *data)
}
if (irq_src & MAX8997_IRQSRC_FLASH) {
/* Flash Status Interrupt */
- ret = max8997_read_reg(max8997->i2c, MAX8997_REG_FLASHSTATUS,
+ ret = regmap_read(max8997->regmap, MAX8997_REG_FLASHSTATUS,
&irq_reg[FLASH_STATUS]);
}
@@ -312,7 +301,7 @@ int max8997_irq_init(struct max8997_dev *max8997)
struct irq_domain *domain;
int i;
int ret;
- u8 val;
+ unsigned int val;
if (!max8997->irq) {
dev_warn(max8997->dev, "No interrupt specified.\n");
@@ -323,22 +312,19 @@ int max8997_irq_init(struct max8997_dev *max8997)
/* Mask individual interrupt sources */
for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
- struct i2c_client *i2c;
-
max8997->irq_masks_cur[i] = 0xff;
max8997->irq_masks_cache[i] = 0xff;
- i2c = get_i2c(max8997, i);
- if (IS_ERR_OR_NULL(i2c))
+ if (IS_ERR_OR_NULL(max8997->regmap))
continue;
if (max8997_mask_reg[i] == MAX8997_REG_INVALID)
continue;
- max8997_write_reg(i2c, max8997_mask_reg[i], 0xff);
+ regmap_write(max8997->regmap, max8997_mask_reg[i], 0xff);
}
for (i = 0; i < MAX8997_NUM_GPIO; i++) {
- max8997->gpio_status[i] = (max8997_read_reg(max8997->i2c,
+ max8997->gpio_status[i] = (regmap_read(max8997->regmap,
MAX8997_REG_GPIOCNTL1 + i,
&val)
& MAX8997_GPIO_DATA_MASK) ?
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index 5adede0..ca6f310 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -33,6 +33,7 @@
#include <linux/mfd/core.h>
#include <linux/mfd/max8997.h>
#include <linux/mfd/max8997-private.h>
+#include <linux/regmap.h>
#define I2C_ADDR_PMIC (0xCC >> 1)
#define I2C_ADDR_MUIC (0x4A >> 1)
@@ -57,81 +58,29 @@ static struct of_device_id max8997_pmic_dt_match[] = {
};
#endif
-int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest)
-{
- struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
- int ret;
-
- mutex_lock(&max8997->iolock);
- ret = i2c_smbus_read_byte_data(i2c, reg);
- mutex_unlock(&max8997->iolock);
- if (ret < 0)
- return ret;
-
- ret &= 0xff;
- *dest = ret;
- return 0;
-}
-EXPORT_SYMBOL_GPL(max8997_read_reg);
-
-int max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count, u8 *buf)
-{
- struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
- int ret;
-
- mutex_lock(&max8997->iolock);
- ret = i2c_smbus_read_i2c_block_data(i2c, reg, count, buf);
- mutex_unlock(&max8997->iolock);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(max8997_bulk_read);
-
-int max8997_write_reg(struct i2c_client *i2c, u8 reg, u8 value)
-{
- struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
- int ret;
-
- mutex_lock(&max8997->iolock);
- ret = i2c_smbus_write_byte_data(i2c, reg, value);
- mutex_unlock(&max8997->iolock);
- return ret;
-}
-EXPORT_SYMBOL_GPL(max8997_write_reg);
-
-int max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count, u8 *buf)
-{
- struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
- int ret;
+static const struct regmap_config max8997_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = MAX8997_REG_PMIC_END,
+};
- mutex_lock(&max8997->iolock);
- ret = i2c_smbus_write_i2c_block_data(i2c, reg, count, buf);
- mutex_unlock(&max8997->iolock);
- if (ret < 0)
- return ret;
+static const struct regmap_config max8997_regmap_rtc_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = MAX8997_RTC_REG_END,
+};
- return 0;
-}
-EXPORT_SYMBOL_GPL(max8997_bulk_write);
+static const struct regmap_config max8997_regmap_haptic_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = MAX8997_HAPTIC_REG_END,
+};
-int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask)
-{
- struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
- int ret;
-
- mutex_lock(&max8997->iolock);
- ret = i2c_smbus_read_byte_data(i2c, reg);
- if (ret >= 0) {
- u8 old_val = ret & 0xff;
- u8 new_val = (val & mask) | (old_val & (~mask));
- ret = i2c_smbus_write_byte_data(i2c, reg, new_val);
- }
- mutex_unlock(&max8997->iolock);
- return ret;
-}
-EXPORT_SYMBOL_GPL(max8997_update_reg);
+static const struct regmap_config max8997_regmap_muic_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = MAX8997_MUIC_REG_END,
+};
/*
* Only the common platform data elements for max8997 are parsed here from the
@@ -209,11 +158,48 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
max8997->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC);
i2c_set_clientdata(max8997->rtc, max8997);
+
max8997->haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC);
i2c_set_clientdata(max8997->haptic, max8997);
+
max8997->muic = i2c_new_dummy(i2c->adapter, I2C_ADDR_MUIC);
i2c_set_clientdata(max8997->muic, max8997);
+ max8997->regmap = devm_regmap_init_i2c(i2c, &max8997_regmap_config);
+ if (IS_ERR(max8997->regmap)) {
+ ret = PTR_ERR(max8997->regmap);
+ dev_err(max8997->dev,
+ "failed to allocate register map: %d\n", ret);
+ return ret;
+ }
+
+ max8997->regmap_rtc = devm_regmap_init_i2c(max8997->rtc,
+ &max8997_regmap_rtc_config);
+ if (IS_ERR(max8997->regmap_rtc)) {
+ ret = PTR_ERR(max8997->regmap_rtc);
+ dev_err(max8997->dev,
+ "failed to allocate register map: %d\n", ret);
+ goto err_regmap;
+ }
+
+ max8997->regmap_haptic = devm_regmap_init_i2c(max8997->haptic,
+ &max8997_regmap_haptic_config);
+ if (IS_ERR(max8997->regmap_haptic)) {
+ ret = PTR_ERR(max8997->regmap_haptic);
+ dev_err(max8997->dev,
+ "failed to allocate register map: %d\n", ret);
+ goto err_regmap;
+ }
+
+ max8997->regmap_muic = devm_regmap_init_i2c(max8997->muic,
+ &max8997_regmap_muic_config);
+ if (IS_ERR(max8997->regmap_muic)) {
+ ret = PTR_ERR(max8997->regmap_muic);
+ dev_err(max8997->dev,
+ "failed to allocate register map: %d\n", ret);
+ goto err_regmap;
+ }
+
pm_runtime_set_active(max8997->dev);
max8997_irq_init(max8997);
@@ -238,6 +224,7 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
err_mfd:
mfd_remove_devices(max8997->dev);
+err_regmap:
i2c_unregister_device(max8997->muic);
i2c_unregister_device(max8997->haptic);
i2c_unregister_device(max8997->rtc);
@@ -423,15 +410,15 @@ static int max8997_freeze(struct device *dev)
int i;
for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_pmic); i++)
- max8997_read_reg(i2c, max8997_dumpaddr_pmic[i],
+ regmap_read(max8997->regmap, max8997_dumpaddr_pmic[i],
&max8997->reg_dump[i]);
for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_muic); i++)
- max8997_read_reg(i2c, max8997_dumpaddr_muic[i],
+ regmap_read(max8997->regmap_muic, max8997_dumpaddr_muic[i],
&max8997->reg_dump[i + MAX8997_REG_PMIC_END]);
for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_haptic); i++)
- max8997_read_reg(i2c, max8997_dumpaddr_haptic[i],
+ regmap_read(max8997->regmap_haptic, max8997_dumpaddr_haptic[i],
&max8997->reg_dump[i + MAX8997_REG_PMIC_END +
MAX8997_MUIC_REG_END]);
@@ -445,15 +432,15 @@ static int max8997_restore(struct device *dev)
int i;
for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_pmic); i++)
- max8997_write_reg(i2c, max8997_dumpaddr_pmic[i],
+ regmap_write(max8997->regmap, max8997_dumpaddr_pmic[i],
max8997->reg_dump[i]);
for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_muic); i++)
- max8997_write_reg(i2c, max8997_dumpaddr_muic[i],
+ regmap_write(max8997->regmap_muic, max8997_dumpaddr_muic[i],
max8997->reg_dump[i + MAX8997_REG_PMIC_END]);
for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_haptic); i++)
- max8997_write_reg(i2c, max8997_dumpaddr_haptic[i],
+ regmap_write(max8997->regmap_haptic, max8997_dumpaddr_haptic[i],
max8997->reg_dump[i + MAX8997_REG_PMIC_END +
MAX8997_MUIC_REG_END]);
diff --git a/drivers/power/max8997_charger.c b/drivers/power/max8997_charger.c
index 4bdedfe..43d8481 100644
--- a/drivers/power/max8997_charger.c
+++ b/drivers/power/max8997_charger.c
@@ -26,6 +26,7 @@
#include <linux/power_supply.h>
#include <linux/mfd/max8997.h>
#include <linux/mfd/max8997-private.h>
+#include <linux/regmap.h>
struct charger_data {
struct device *dev;
@@ -46,14 +47,14 @@ static int max8997_battery_get_property(struct power_supply *psy,
{
struct charger_data *charger = container_of(psy,
struct charger_data, battery);
- struct i2c_client *i2c = charger->iodev->i2c;
int ret;
- u8 reg;
+ unsigned int reg;
switch (psp) {
case POWER_SUPPLY_PROP_STATUS:
val->intval = 0;
- ret = max8997_read_reg(i2c, MAX8997_REG_STATUS4, ®);
+ ret = regmap_read(charger->iodev->regmap,
+ MAX8997_REG_STATUS4, ®);
if (ret)
return ret;
if ((reg & (1 << 0)) == 0x1)
@@ -62,7 +63,8 @@ static int max8997_battery_get_property(struct power_supply *psy,
break;
case POWER_SUPPLY_PROP_PRESENT:
val->intval = 0;
- ret = max8997_read_reg(i2c, MAX8997_REG_STATUS4, ®);
+ ret = regmap_read(charger->iodev->regmap,
+ MAX8997_REG_STATUS4, ®);
if (ret)
return ret;
if ((reg & (1 << 2)) == 0x0)
@@ -71,7 +73,8 @@ static int max8997_battery_get_property(struct power_supply *psy,
break;
case POWER_SUPPLY_PROP_ONLINE:
val->intval = 0;
- ret = max8997_read_reg(i2c, MAX8997_REG_STATUS4, ®);
+ ret = regmap_read(charger->iodev->regmap,
+ MAX8997_REG_STATUS4, ®);
if (ret)
return ret;
/* DCINOK */
@@ -103,8 +106,8 @@ static int max8997_battery_probe(struct platform_device *pdev)
if (val > 0xf)
val = 0xf;
- ret = max8997_update_reg(iodev->i2c,
- MAX8997_REG_MBCCTRL5, val, 0xf);
+ ret = regmap_update_bits(iodev->regmap,
+ MAX8997_REG_MBCCTRL5, 0xf, val);
if (ret < 0) {
dev_err(&pdev->dev, "Cannot use i2c bus.\n");
return ret;
@@ -113,20 +116,20 @@ static int max8997_battery_probe(struct platform_device *pdev)
switch (pdata->timeout) {
case 5:
- ret = max8997_update_reg(iodev->i2c, MAX8997_REG_MBCCTRL1,
- 0x2 << 4, 0x7 << 4);
+ ret = regmap_update_bits(iodev->regmap,
+ MAX8997_REG_MBCCTRL1, 0x7 << 4, 0x2 << 4);
break;
case 6:
- ret = max8997_update_reg(iodev->i2c, MAX8997_REG_MBCCTRL1,
- 0x3 << 4, 0x7 << 4);
+ ret = regmap_update_bits(iodev->regmap,
+ MAX8997_REG_MBCCTRL1, 0x7 << 4, 0x3 << 4);
break;
case 7:
- ret = max8997_update_reg(iodev->i2c, MAX8997_REG_MBCCTRL1,
- 0x4 << 4, 0x7 << 4);
+ ret = regmap_update_bits(iodev->regmap,
+ MAX8997_REG_MBCCTRL1, 0x7 << 4, 0x4 << 4);
break;
case 0:
- ret = max8997_update_reg(iodev->i2c, MAX8997_REG_MBCCTRL1,
- 0x7 << 4, 0x7 << 4);
+ ret = regmap_update_bits(iodev->regmap,
+ MAX8997_REG_MBCCTRL1, 0x7 << 4, 0x7 << 4);
break;
default:
dev_err(&pdev->dev, "incorrect timeout value (%d)\n",
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index 2d618fc..4001ed7 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -33,6 +33,7 @@
#include <linux/mfd/max8997.h>
#include <linux/mfd/max8997-private.h>
#include <linux/regulator/of_regulator.h>
+#include <linux/regmap.h>
struct max8997_data {
struct device *dev;
@@ -51,7 +52,7 @@ struct max8997_data {
int buck125_gpioindex;
bool ignore_gpiodvs_side_effect;
- u8 saved_states[MAX8997_REG_MAX];
+ unsigned int saved_states[MAX8997_REG_MAX];
};
static const unsigned int safeoutvolt[] = {
@@ -258,15 +259,14 @@ static int max8997_get_enable_register(struct regulator_dev *rdev,
static int max8997_reg_is_enabled(struct regulator_dev *rdev)
{
struct max8997_data *max8997 = rdev_get_drvdata(rdev);
- struct i2c_client *i2c = max8997->iodev->i2c;
int ret, reg, mask, pattern;
- u8 val;
+ unsigned int val;
ret = max8997_get_enable_register(rdev, ®, &mask, &pattern);
if (ret)
return ret;
- ret = max8997_read_reg(i2c, reg, &val);
+ ret = regmap_read(max8997->iodev->regmap, reg, &val);
if (ret)
return ret;
@@ -276,27 +276,25 @@ static int max8997_reg_is_enabled(struct regulator_dev *rdev)
static int max8997_reg_enable(struct regulator_dev *rdev)
{
struct max8997_data *max8997 = rdev_get_drvdata(rdev);
- struct i2c_client *i2c = max8997->iodev->i2c;
int ret, reg, mask, pattern;
ret = max8997_get_enable_register(rdev, ®, &mask, &pattern);
if (ret)
return ret;
- return max8997_update_reg(i2c, reg, pattern, mask);
+ return regmap_update_bits(max8997->iodev->regmap, reg, mask, pattern);
}
static int max8997_reg_disable(struct regulator_dev *rdev)
{
struct max8997_data *max8997 = rdev_get_drvdata(rdev);
- struct i2c_client *i2c = max8997->iodev->i2c;
int ret, reg, mask, pattern;
ret = max8997_get_enable_register(rdev, ®, &mask, &pattern);
if (ret)
return ret;
- return max8997_update_reg(i2c, reg, ~pattern, mask);
+ return regmap_update_bits(max8997->iodev->regmap, reg, mask, ~pattern);
}
static int max8997_get_voltage_register(struct regulator_dev *rdev,
@@ -368,15 +366,14 @@ static int max8997_get_voltage_register(struct regulator_dev *rdev,
static int max8997_get_voltage_sel(struct regulator_dev *rdev)
{
struct max8997_data *max8997 = rdev_get_drvdata(rdev);
- struct i2c_client *i2c = max8997->iodev->i2c;
int reg, shift, mask, ret;
- u8 val;
+ unsigned int val;
ret = max8997_get_voltage_register(rdev, ®, &shift, &mask);
if (ret)
return ret;
- ret = max8997_read_reg(i2c, reg, &val);
+ ret = regmap_read(max8997->iodev->regmap, reg, &val);
if (ret)
return ret;
@@ -413,7 +410,6 @@ static int max8997_set_voltage_charger_cv(struct regulator_dev *rdev,
int min_uV, int max_uV, unsigned *selector)
{
struct max8997_data *max8997 = rdev_get_drvdata(rdev);
- struct i2c_client *i2c = max8997->iodev->i2c;
int rid = rdev_get_id(rdev);
int lb, ub;
int reg, shift = 0, mask, ret = 0;
@@ -455,7 +451,8 @@ static int max8997_set_voltage_charger_cv(struct regulator_dev *rdev,
*selector = val;
- ret = max8997_update_reg(i2c, reg, val << shift, mask);
+ ret = regmap_update_bits(max8997->iodev->regmap,
+ reg, mask, val << shift);
return ret;
}
@@ -468,7 +465,6 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
int min_uV, int max_uV, unsigned *selector)
{
struct max8997_data *max8997 = rdev_get_drvdata(rdev);
- struct i2c_client *i2c = max8997->iodev->i2c;
const struct voltage_map_desc *desc;
int rid = rdev_get_id(rdev);
int i, reg, shift, mask, ret;
@@ -500,7 +496,8 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
if (ret)
return ret;
- ret = max8997_update_reg(i2c, reg, i << shift, mask << shift);
+ ret = regmap_update_bits(max8997->iodev->regmap,
+ reg, mask << shift, i << shift);
*selector = i;
return ret;
@@ -710,7 +707,6 @@ static int max8997_set_voltage_safeout_sel(struct regulator_dev *rdev,
unsigned selector)
{
struct max8997_data *max8997 = rdev_get_drvdata(rdev);
- struct i2c_client *i2c = max8997->iodev->i2c;
int rid = rdev_get_id(rdev);
int reg, shift = 0, mask, ret;
@@ -721,13 +717,13 @@ static int max8997_set_voltage_safeout_sel(struct regulator_dev *rdev,
if (ret)
return ret;
- return max8997_update_reg(i2c, reg, selector << shift, mask << shift);
+ return regmap_update_bits(max8997->iodev->regmap,
+ reg, mask << shift, selector << shift);
}
static int max8997_reg_disable_suspend(struct regulator_dev *rdev)
{
struct max8997_data *max8997 = rdev_get_drvdata(rdev);
- struct i2c_client *i2c = max8997->iodev->i2c;
int ret, reg, mask, pattern;
int rid = rdev_get_id(rdev);
@@ -735,20 +731,22 @@ static int max8997_reg_disable_suspend(struct regulator_dev *rdev)
if (ret)
return ret;
- max8997_read_reg(i2c, reg, &max8997->saved_states[rid]);
+ regmap_read(max8997->iodev->regmap,
+ reg, &max8997->saved_states[rid]);
if (rid == MAX8997_LDO1 ||
rid == MAX8997_LDO10 ||
rid == MAX8997_LDO21) {
dev_dbg(&rdev->dev, "Conditional Power-Off for %s\n",
rdev->desc->name);
- return max8997_update_reg(i2c, reg, 0x40, mask);
+ return regmap_update_bits(max8997->iodev->regmap,
+ reg, mask, 0x40);
}
dev_dbg(&rdev->dev, "Full Power-Off for %s (%xh -> %xh)\n",
rdev->desc->name, max8997->saved_states[rid] & mask,
(~pattern) & mask);
- return max8997_update_reg(i2c, reg, ~pattern, mask);
+ return regmap_update_bits(max8997->iodev->regmap, reg, mask, ~pattern);
}
static struct regulator_ops max8997_ldo_ops = {
@@ -1032,7 +1030,6 @@ static int max8997_pmic_probe(struct platform_device *pdev)
struct regulator_config config = { };
struct regulator_dev **rdev;
struct max8997_data *max8997;
- struct i2c_client *i2c;
int i, ret, size, nr_dvs;
u8 max_buck1 = 0, max_buck2 = 0, max_buck5 = 0;
@@ -1062,7 +1059,6 @@ static int max8997_pmic_probe(struct platform_device *pdev)
max8997->iodev = iodev;
max8997->num_regulators = pdata->num_regulators;
platform_set_drvdata(pdev, max8997);
- i2c = max8997->iodev->i2c;
max8997->buck125_gpioindex = pdata->buck125_default_idx;
max8997->buck1_gpiodvs = pdata->buck1_gpiodvs;
@@ -1112,25 +1108,25 @@ static int max8997_pmic_probe(struct platform_device *pdev)
/* For the safety, set max voltage before setting up */
for (i = 0; i < 8; i++) {
- max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i,
- max_buck1, 0x3f);
- max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i,
- max_buck2, 0x3f);
- max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i,
- max_buck5, 0x3f);
+ regmap_update_bits(max8997->iodev->regmap,
+ MAX8997_REG_BUCK1DVS1 + i, 0x3f, max_buck1);
+ regmap_update_bits(max8997->iodev->regmap,
+ MAX8997_REG_BUCK2DVS1 + i, 0x3f, max_buck2);
+ regmap_update_bits(max8997->iodev->regmap,
+ MAX8997_REG_BUCK5DVS1 + i, 0x3f, max_buck5);
}
/* Initialize all the DVS related BUCK registers */
for (i = 0; i < nr_dvs; i++) {
- max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i,
- max8997->buck1_vol[i],
- 0x3f);
- max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i,
- max8997->buck2_vol[i],
- 0x3f);
- max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i,
- max8997->buck5_vol[i],
- 0x3f);
+ regmap_update_bits(max8997->iodev->regmap,
+ MAX8997_REG_BUCK1DVS1 + i,
+ 0x3f, max8997->buck1_vol[i]);
+ regmap_update_bits(max8997->iodev->regmap,
+ MAX8997_REG_BUCK2DVS1 + i,
+ 0x3f, max8997->buck2_vol[i]);
+ regmap_update_bits(max8997->iodev->regmap,
+ MAX8997_REG_BUCK5DVS1 + i,
+ 0x3f, max8997->buck5_vol[i]);
}
/*
@@ -1174,16 +1170,17 @@ static int max8997_pmic_probe(struct platform_device *pdev)
}
/* DVS-GPIO disabled */
- max8997_update_reg(i2c, MAX8997_REG_BUCK1CTRL, (pdata->buck1_gpiodvs) ?
- (1 << 1) : (0 << 1), 1 << 1);
- max8997_update_reg(i2c, MAX8997_REG_BUCK2CTRL, (pdata->buck2_gpiodvs) ?
- (1 << 1) : (0 << 1), 1 << 1);
- max8997_update_reg(i2c, MAX8997_REG_BUCK5CTRL, (pdata->buck5_gpiodvs) ?
- (1 << 1) : (0 << 1), 1 << 1);
+ regmap_update_bits(max8997->iodev->regmap, MAX8997_REG_BUCK1CTRL,
+ 1 << 1, (pdata->buck1_gpiodvs) ? (1 << 1) : (0 << 1));
+ regmap_update_bits(max8997->iodev->regmap, MAX8997_REG_BUCK2CTRL,
+ 1 << 1, (pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1));
+ regmap_update_bits(max8997->iodev->regmap, MAX8997_REG_BUCK5CTRL,
+ 1 << 1, (pdata->buck5_gpiodvs) ? (1 << 1) : (0 << 1));
/* Misc Settings */
max8997->ramp_delay = 10; /* set 10mV/us, which is the default */
- max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9);
+ regmap_write(max8997->iodev->regmap,
+ MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9);
for (i = 0; i < pdata->num_regulators; i++) {
const struct voltage_map_desc *desc;
diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
index 0777c01..b866f7d5 100644
--- a/drivers/rtc/rtc-max8997.c
+++ b/drivers/rtc/rtc-max8997.c
@@ -20,6 +20,7 @@
#include <linux/platform_device.h>
#include <linux/mfd/max8997-private.h>
#include <linux/irqdomain.h>
+#include <linux/regmap.h>
/* Module parameter for WTSR function control */
static int wtsr_en = 1;
@@ -68,7 +69,6 @@ enum {
struct max8997_rtc_info {
struct device *dev;
struct max8997_dev *max8997;
- struct i2c_client *rtc;
struct rtc_device *rtc_dev;
struct mutex lock;
int virq;
@@ -118,8 +118,8 @@ static inline int max8997_rtc_set_update_reg(struct max8997_rtc_info *info)
{
int ret;
- ret = max8997_write_reg(info->rtc, MAX8997_RTC_UPDATE1,
- RTC_UDR_MASK);
+ ret = regmap_write(info->max8997->regmap_rtc,
+ MAX8997_RTC_UPDATE1, RTC_UDR_MASK);
if (ret < 0)
dev_err(info->dev, "%s: fail to write update reg(%d)\n",
__func__, ret);
@@ -140,7 +140,8 @@ static int max8997_rtc_read_time(struct device *dev, struct rtc_time *tm)
int ret;
mutex_lock(&info->lock);
- ret = max8997_bulk_read(info->rtc, MAX8997_RTC_SEC, RTC_NR_TIME, data);
+ ret = regmap_bulk_read(info->max8997->regmap_rtc,
+ MAX8997_RTC_SEC, data, RTC_NR_TIME);
mutex_unlock(&info->lock);
if (ret < 0) {
@@ -166,7 +167,8 @@ static int max8997_rtc_set_time(struct device *dev, struct rtc_time *tm)
mutex_lock(&info->lock);
- ret = max8997_bulk_write(info->rtc, MAX8997_RTC_SEC, RTC_NR_TIME, data);
+ ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ MAX8997_RTC_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write time reg(%d)\n", __func__,
ret);
@@ -183,13 +185,13 @@ static int max8997_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
struct max8997_rtc_info *info = dev_get_drvdata(dev);
u8 data[RTC_NR_TIME];
- u8 val;
+ unsigned int val;
int i, ret;
mutex_lock(&info->lock);
- ret = max8997_bulk_read(info->rtc, MAX8997_RTC_ALARM1_SEC, RTC_NR_TIME,
- data);
+ ret = regmap_bulk_read(info->max8997->regmap_rtc,
+ MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s:%d fail to read alarm reg(%d)\n",
__func__, __LINE__, ret);
@@ -207,7 +209,8 @@ static int max8997_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
}
alrm->pending = 0;
- ret = max8997_read_reg(info->max8997->i2c, MAX8997_REG_STATUS1, &val);
+ ret = regmap_read(info->max8997->regmap_rtc,
+ MAX8997_REG_STATUS1, &val);
if (ret < 0) {
dev_err(info->dev, "%s:%d fail to read status1 reg(%d)\n",
__func__, __LINE__, ret);
@@ -230,8 +233,8 @@ static int max8997_rtc_stop_alarm(struct max8997_rtc_info *info)
if (!mutex_is_locked(&info->lock))
dev_warn(info->dev, "%s: should have mutex locked\n", __func__);
- ret = max8997_bulk_read(info->rtc, MAX8997_RTC_ALARM1_SEC, RTC_NR_TIME,
- data);
+ ret = regmap_bulk_read(info->max8997->regmap_rtc,
+ MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to read alarm reg(%d)\n",
__func__, ret);
@@ -241,8 +244,8 @@ static int max8997_rtc_stop_alarm(struct max8997_rtc_info *info)
for (i = 0; i < RTC_NR_TIME; i++)
data[i] &= ~ALARM_ENABLE_MASK;
- ret = max8997_bulk_write(info->rtc, MAX8997_RTC_ALARM1_SEC, RTC_NR_TIME,
- data);
+ ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
__func__, ret);
@@ -262,8 +265,8 @@ static int max8997_rtc_start_alarm(struct max8997_rtc_info *info)
if (!mutex_is_locked(&info->lock))
dev_warn(info->dev, "%s: should have mutex locked\n", __func__);
- ret = max8997_bulk_read(info->rtc, MAX8997_RTC_ALARM1_SEC, RTC_NR_TIME,
- data);
+ ret = regmap_bulk_read(info->max8997->regmap_rtc,
+ MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to read alarm reg(%d)\n",
__func__, ret);
@@ -281,8 +284,8 @@ static int max8997_rtc_start_alarm(struct max8997_rtc_info *info)
if (data[RTC_DATE] & 0x1f)
data[RTC_DATE] |= (1 << ALARM_ENABLE_SHIFT);
- ret = max8997_bulk_write(info->rtc, MAX8997_RTC_ALARM1_SEC, RTC_NR_TIME,
- data);
+ ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
__func__, ret);
@@ -313,8 +316,8 @@ static int max8997_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
if (ret < 0)
goto out;
- ret = max8997_bulk_write(info->rtc, MAX8997_RTC_ALARM1_SEC, RTC_NR_TIME,
- data);
+ ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
__func__, ret);
@@ -385,7 +388,8 @@ static void max8997_rtc_enable_wtsr(struct max8997_rtc_info *info, bool enable)
dev_info(info->dev, "%s: %s WTSR\n", __func__,
enable ? "enable" : "disable");
- ret = max8997_update_reg(info->rtc, MAX8997_RTC_WTSR_SMPL, val, mask);
+ ret = regmap_update_bits(info->max8997->regmap_rtc,
+ MAX8997_RTC_WTSR_SMPL, mask, val);
if (ret < 0) {
dev_err(info->dev, "%s: fail to update WTSR reg(%d)\n",
__func__, ret);
@@ -398,7 +402,7 @@ static void max8997_rtc_enable_wtsr(struct max8997_rtc_info *info, bool enable)
static void max8997_rtc_enable_smpl(struct max8997_rtc_info *info, bool enable)
{
int ret;
- u8 val, mask;
+ unsigned int val, mask;
if (!smpl_en)
return;
@@ -413,7 +417,8 @@ static void max8997_rtc_enable_smpl(struct max8997_rtc_info *info, bool enable)
dev_info(info->dev, "%s: %s SMPL\n", __func__,
enable ? "enable" : "disable");
- ret = max8997_update_reg(info->rtc, MAX8997_RTC_WTSR_SMPL, val, mask);
+ ret = regmap_update_bits(info->max8997->regmap_rtc,
+ MAX8997_RTC_WTSR_SMPL, mask, val);
if (ret < 0) {
dev_err(info->dev, "%s: fail to update SMPL reg(%d)\n",
__func__, ret);
@@ -423,7 +428,8 @@ static void max8997_rtc_enable_smpl(struct max8997_rtc_info *info, bool enable)
max8997_rtc_set_update_reg(info);
val = 0;
- max8997_read_reg(info->rtc, MAX8997_RTC_WTSR_SMPL, &val);
+ regmap_read(info->max8997->regmap_rtc,
+ MAX8997_RTC_WTSR_SMPL, &val);
pr_info("%s: WTSR_SMPL(0x%02x)\n", __func__, val);
}
@@ -438,7 +444,8 @@ static int max8997_rtc_init_reg(struct max8997_rtc_info *info)
info->rtc_24hr_mode = 1;
- ret = max8997_bulk_write(info->rtc, MAX8997_RTC_CTRLMASK, 2, data);
+ ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ MAX8997_RTC_CTRLMASK, data, 2);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write controlm reg(%d)\n",
__func__, ret);
@@ -463,7 +470,6 @@ static int max8997_rtc_probe(struct platform_device *pdev)
mutex_init(&info->lock);
info->dev = &pdev->dev;
info->max8997 = max8997;
- info->rtc = max8997->rtc;
platform_set_drvdata(pdev, info);
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 78c76cd..ea80ef8 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -309,6 +309,8 @@ enum max8997_rtc_reg {
MAX8997_RTC_ALARM2_MONTH = 0x22,
MAX8997_RTC_ALARM2_YEAR = 0x23,
MAX8997_RTC_ALARM2_DAY_OF_MONTH = 0x24,
+
+ MAX8997_RTC_REG_END = 0x25,
};
enum max8997_irq_source {
@@ -390,6 +392,11 @@ struct max8997_dev {
unsigned long type;
struct platform_device *battery; /* battery control (not fuel gauge) */
+ struct regmap *regmap;
+ struct regmap *regmap_rtc;
+ struct regmap *regmap_haptic;
+ struct regmap *regmap_muic;
+
int irq;
int ono;
struct irq_domain *irq_domain;
@@ -398,7 +405,7 @@ struct max8997_dev {
int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
/* For hibernation */
- u8 reg_dump[MAX8997_REG_PMIC_END + MAX8997_MUIC_REG_END +
+ unsigned int reg_dump[MAX8997_REG_PMIC_END + MAX8997_MUIC_REG_END +
MAX8997_HAPTIC_REG_END];
bool gpio_status[MAX8997_NUM_GPIO];
@@ -413,14 +420,6 @@ extern int max8997_irq_init(struct max8997_dev *max8997);
extern void max8997_irq_exit(struct max8997_dev *max8997);
extern int max8997_irq_resume(struct max8997_dev *max8997);
-extern int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
-extern int max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count,
- u8 *buf);
-extern int max8997_write_reg(struct i2c_client *i2c, u8 reg, u8 value);
-extern int max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count,
- u8 *buf);
-extern int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);
-
#define MAX8997_GPIO_INT_BOTH (0x3 << 4)
#define MAX8997_GPIO_INT_RISE (0x2 << 4)
#define MAX8997_GPIO_INT_FALL (0x1 << 4)
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/3] mfd: max8997: handle IRQs using regmap
From: Robert Baldyga @ 2014-03-11 13:58 UTC (permalink / raw)
To: sameo, lee.jones
Cc: myungjoo.ham, cw00.choi, dmitry.torokhov, cooloney, rpurdie,
dbaryshkov, dwmw2, lgirdwood, broonie, a.zummo, paul.gortmaker,
linux-kernel, linux-input, linux-leds, rtc-linux, m.szyprowski,
k.kozlowski, Robert Baldyga
In-Reply-To: <1394546304-15191-1-git-send-email-r.baldyga@samsung.com>
This patch modifies mfd driver to use regmap for handling interrupts.
It allows to simplify irq handling process. This modifications needed
to make small changes in function drivers, which use interrupts.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
drivers/extcon/extcon-max8997.c | 3 +-
drivers/mfd/Makefile | 2 +-
drivers/mfd/max8997-irq.c | 373 -----------------------------------
drivers/mfd/max8997.c | 91 ++++++++-
drivers/rtc/rtc-max8997.c | 2 +-
include/linux/mfd/max8997-private.h | 63 +++++-
6 files changed, 147 insertions(+), 387 deletions(-)
delete mode 100644 drivers/mfd/max8997-irq.c
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index f258c08..5948061 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -679,7 +679,8 @@ static int max8997_muic_probe(struct platform_device *pdev)
struct max8997_muic_irq *muic_irq = &muic_irqs[i];
unsigned int virq = 0;
- virq = irq_create_mapping(max8997->irq_domain, muic_irq->irq);
+ virq = regmap_irq_get_virq(max8997->irq_data_muic,
+ muic_irq->irq);
if (!virq) {
ret = -EINVAL;
goto err_irq;
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 5aea5ef..db2a1eb 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -117,7 +117,7 @@ obj-$(CONFIG_MFD_MAX77693) += max77693.o max77693-irq.o
obj-$(CONFIG_MFD_MAX8907) += max8907.o
max8925-objs := max8925-core.o max8925-i2c.o
obj-$(CONFIG_MFD_MAX8925) += max8925.o
-obj-$(CONFIG_MFD_MAX8997) += max8997.o max8997-irq.o
+obj-$(CONFIG_MFD_MAX8997) += max8997.o
obj-$(CONFIG_MFD_MAX8998) += max8998.o max8998-irq.o
pcf50633-objs := pcf50633-core.o pcf50633-irq.o
diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
deleted file mode 100644
index 656d03b..0000000
--- a/drivers/mfd/max8997-irq.c
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * max8997-irq.c - Interrupt controller support for MAX8997
- *
- * Copyright (C) 2011 Samsung Electronics Co.Ltd
- * MyungJoo Ham <myungjoo.ham@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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * This driver is based on max8998-irq.c
- */
-
-#include <linux/err.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/mfd/max8997.h>
-#include <linux/mfd/max8997-private.h>
-#include <linux/regmap.h>
-
-static const u8 max8997_mask_reg[] = {
- [PMIC_INT1] = MAX8997_REG_INT1MSK,
- [PMIC_INT2] = MAX8997_REG_INT2MSK,
- [PMIC_INT3] = MAX8997_REG_INT3MSK,
- [PMIC_INT4] = MAX8997_REG_INT4MSK,
- [FUEL_GAUGE] = MAX8997_REG_INVALID,
- [MUIC_INT1] = MAX8997_MUIC_REG_INTMASK1,
- [MUIC_INT2] = MAX8997_MUIC_REG_INTMASK2,
- [MUIC_INT3] = MAX8997_MUIC_REG_INTMASK3,
- [GPIO_LOW] = MAX8997_REG_INVALID,
- [GPIO_HI] = MAX8997_REG_INVALID,
- [FLASH_STATUS] = MAX8997_REG_INVALID,
-};
-
-struct max8997_irq_data {
- int mask;
- enum max8997_irq_source group;
-};
-
-#define DECLARE_IRQ(idx, _group, _mask) \
- [(idx)] = { .group = (_group), .mask = (_mask) }
-static const struct max8997_irq_data max8997_irqs[] = {
- DECLARE_IRQ(MAX8997_PMICIRQ_PWRONR, PMIC_INT1, 1 << 0),
- DECLARE_IRQ(MAX8997_PMICIRQ_PWRONF, PMIC_INT1, 1 << 1),
- DECLARE_IRQ(MAX8997_PMICIRQ_PWRON1SEC, PMIC_INT1, 1 << 3),
- DECLARE_IRQ(MAX8997_PMICIRQ_JIGONR, PMIC_INT1, 1 << 4),
- DECLARE_IRQ(MAX8997_PMICIRQ_JIGONF, PMIC_INT1, 1 << 5),
- DECLARE_IRQ(MAX8997_PMICIRQ_LOWBAT2, PMIC_INT1, 1 << 6),
- DECLARE_IRQ(MAX8997_PMICIRQ_LOWBAT1, PMIC_INT1, 1 << 7),
-
- DECLARE_IRQ(MAX8997_PMICIRQ_JIGR, PMIC_INT2, 1 << 0),
- DECLARE_IRQ(MAX8997_PMICIRQ_JIGF, PMIC_INT2, 1 << 1),
- DECLARE_IRQ(MAX8997_PMICIRQ_MR, PMIC_INT2, 1 << 2),
- DECLARE_IRQ(MAX8997_PMICIRQ_DVS1OK, PMIC_INT2, 1 << 3),
- DECLARE_IRQ(MAX8997_PMICIRQ_DVS2OK, PMIC_INT2, 1 << 4),
- DECLARE_IRQ(MAX8997_PMICIRQ_DVS3OK, PMIC_INT2, 1 << 5),
- DECLARE_IRQ(MAX8997_PMICIRQ_DVS4OK, PMIC_INT2, 1 << 6),
-
- DECLARE_IRQ(MAX8997_PMICIRQ_CHGINS, PMIC_INT3, 1 << 0),
- DECLARE_IRQ(MAX8997_PMICIRQ_CHGRM, PMIC_INT3, 1 << 1),
- DECLARE_IRQ(MAX8997_PMICIRQ_DCINOVP, PMIC_INT3, 1 << 2),
- DECLARE_IRQ(MAX8997_PMICIRQ_TOPOFFR, PMIC_INT3, 1 << 3),
- DECLARE_IRQ(MAX8997_PMICIRQ_CHGRSTF, PMIC_INT3, 1 << 5),
- DECLARE_IRQ(MAX8997_PMICIRQ_MBCHGTMEXPD, PMIC_INT3, 1 << 7),
-
- DECLARE_IRQ(MAX8997_PMICIRQ_RTC60S, PMIC_INT4, 1 << 0),
- DECLARE_IRQ(MAX8997_PMICIRQ_RTCA1, PMIC_INT4, 1 << 1),
- DECLARE_IRQ(MAX8997_PMICIRQ_RTCA2, PMIC_INT4, 1 << 2),
- DECLARE_IRQ(MAX8997_PMICIRQ_SMPL_INT, PMIC_INT4, 1 << 3),
- DECLARE_IRQ(MAX8997_PMICIRQ_RTC1S, PMIC_INT4, 1 << 4),
- DECLARE_IRQ(MAX8997_PMICIRQ_WTSR, PMIC_INT4, 1 << 5),
-
- DECLARE_IRQ(MAX8997_MUICIRQ_ADCError, MUIC_INT1, 1 << 2),
- DECLARE_IRQ(MAX8997_MUICIRQ_ADCLow, MUIC_INT1, 1 << 1),
- DECLARE_IRQ(MAX8997_MUICIRQ_ADC, MUIC_INT1, 1 << 0),
-
- DECLARE_IRQ(MAX8997_MUICIRQ_VBVolt, MUIC_INT2, 1 << 4),
- DECLARE_IRQ(MAX8997_MUICIRQ_DBChg, MUIC_INT2, 1 << 3),
- DECLARE_IRQ(MAX8997_MUICIRQ_DCDTmr, MUIC_INT2, 1 << 2),
- DECLARE_IRQ(MAX8997_MUICIRQ_ChgDetRun, MUIC_INT2, 1 << 1),
- DECLARE_IRQ(MAX8997_MUICIRQ_ChgTyp, MUIC_INT2, 1 << 0),
-
- DECLARE_IRQ(MAX8997_MUICIRQ_OVP, MUIC_INT3, 1 << 2),
-};
-
-static void max8997_irq_lock(struct irq_data *data)
-{
- struct max8997_dev *max8997 = irq_get_chip_data(data->irq);
-
- mutex_lock(&max8997->irqlock);
-}
-
-static void max8997_irq_sync_unlock(struct irq_data *data)
-{
- struct max8997_dev *max8997 = irq_get_chip_data(data->irq);
- int i;
-
- for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
- struct regmap *map;
- u8 mask_reg = max8997_mask_reg[i];
-
- if (i >= MUIC_INT1 && i <= MUIC_INT3)
- map = max8997->regmap_muic;
- else
- map = max8997->regmap;
-
- if (mask_reg == MAX8997_REG_INVALID ||
- IS_ERR_OR_NULL(map))
- continue;
- max8997->irq_masks_cache[i] = max8997->irq_masks_cur[i];
-
- regmap_write(map, max8997_mask_reg[i],
- max8997->irq_masks_cur[i]);
- }
-
- mutex_unlock(&max8997->irqlock);
-}
-
-static const inline struct max8997_irq_data *
-irq_to_max8997_irq(struct max8997_dev *max8997, int irq)
-{
- struct irq_data *data = irq_get_irq_data(irq);
- return &max8997_irqs[data->hwirq];
-}
-
-static void max8997_irq_mask(struct irq_data *data)
-{
- struct max8997_dev *max8997 = irq_get_chip_data(data->irq);
- const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
- data->irq);
-
- max8997->irq_masks_cur[irq_data->group] |= irq_data->mask;
-}
-
-static void max8997_irq_unmask(struct irq_data *data)
-{
- struct max8997_dev *max8997 = irq_get_chip_data(data->irq);
- const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
- data->irq);
-
- max8997->irq_masks_cur[irq_data->group] &= ~irq_data->mask;
-}
-
-static struct irq_chip max8997_irq_chip = {
- .name = "max8997",
- .irq_bus_lock = max8997_irq_lock,
- .irq_bus_sync_unlock = max8997_irq_sync_unlock,
- .irq_mask = max8997_irq_mask,
- .irq_unmask = max8997_irq_unmask,
-};
-
-#define MAX8997_IRQSRC_PMIC (1 << 1)
-#define MAX8997_IRQSRC_FUELGAUGE (1 << 2)
-#define MAX8997_IRQSRC_MUIC (1 << 3)
-#define MAX8997_IRQSRC_GPIO (1 << 4)
-#define MAX8997_IRQSRC_FLASH (1 << 5)
-static irqreturn_t max8997_irq_thread(int irq, void *data)
-{
- struct max8997_dev *max8997 = data;
- unsigned int irq_reg[MAX8997_IRQ_GROUP_NR] = {};
- unsigned int irq_src;
- int ret;
- int i, cur_irq;
-
- ret = regmap_read(max8997->regmap, MAX8997_REG_INTSRC, &irq_src);
- if (ret < 0) {
- dev_err(max8997->dev, "Failed to read interrupt source: %d\n",
- ret);
- return IRQ_NONE;
- }
-
- if (irq_src & MAX8997_IRQSRC_PMIC) {
- /* PMIC INT1 ~ INT4 */
- for (i = 0; i < 4; ++i)
- regmap_read(max8997->regmap,
- MAX8997_REG_INT1+i, &irq_reg[PMIC_INT1+i]);
- }
- if (irq_src & MAX8997_IRQSRC_FUELGAUGE) {
- /*
- * TODO: FUEL GAUGE
- *
- * This is to be supported by Max17042 driver. When
- * an interrupt incurs here, it should be relayed to a
- * Max17042 device that is connected (probably by
- * platform-data). However, we do not have interrupt
- * handling in Max17042 driver currently. The Max17042 IRQ
- * driver should be ready to be used as a stand-alone device and
- * a Max8997-dependent device. Because it is not ready in
- * Max17042-side and it is not too critical in operating
- * Max8997, we do not implement this in initial releases.
- */
- irq_reg[FUEL_GAUGE] = 0;
- }
- if (irq_src & MAX8997_IRQSRC_MUIC) {
- /* MUIC INT1 ~ INT3 */
- for (i = 0; i < 3; ++i)
- regmap_read(max8997->regmap_muic,
- MAX8997_MUIC_REG_INT1+i, &irq_reg[MUIC_INT1+i]);
- }
- if (irq_src & MAX8997_IRQSRC_GPIO) {
- /* GPIO Interrupt */
- u8 gpio_info[MAX8997_NUM_GPIO];
-
- irq_reg[GPIO_LOW] = 0;
- irq_reg[GPIO_HI] = 0;
-
- regmap_bulk_read(max8997->regmap, MAX8997_REG_GPIOCNTL1,
- gpio_info, MAX8997_NUM_GPIO);
- for (i = 0; i < MAX8997_NUM_GPIO; i++) {
- bool interrupt = false;
-
- switch (gpio_info[i] & MAX8997_GPIO_INT_MASK) {
- case MAX8997_GPIO_INT_BOTH:
- if (max8997->gpio_status[i] != gpio_info[i])
- interrupt = true;
- break;
- case MAX8997_GPIO_INT_RISE:
- if ((max8997->gpio_status[i] != gpio_info[i]) &&
- (gpio_info[i] & MAX8997_GPIO_DATA_MASK))
- interrupt = true;
- break;
- case MAX8997_GPIO_INT_FALL:
- if ((max8997->gpio_status[i] != gpio_info[i]) &&
- !(gpio_info[i] & MAX8997_GPIO_DATA_MASK))
- interrupt = true;
- break;
- default:
- break;
- }
-
- if (interrupt) {
- if (i < 8)
- irq_reg[GPIO_LOW] |= (1 << i);
- else
- irq_reg[GPIO_HI] |= (1 << (i - 8));
- }
-
- }
- }
- if (irq_src & MAX8997_IRQSRC_FLASH) {
- /* Flash Status Interrupt */
- ret = regmap_read(max8997->regmap, MAX8997_REG_FLASHSTATUS,
- &irq_reg[FLASH_STATUS]);
- }
-
- /* Apply masking */
- for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++)
- irq_reg[i] &= ~max8997->irq_masks_cur[i];
-
- /* Report */
- for (i = 0; i < MAX8997_IRQ_NR; i++) {
- if (irq_reg[max8997_irqs[i].group] & max8997_irqs[i].mask) {
- cur_irq = irq_find_mapping(max8997->irq_domain, i);
- if (cur_irq)
- handle_nested_irq(cur_irq);
- }
- }
-
- return IRQ_HANDLED;
-}
-
-int max8997_irq_resume(struct max8997_dev *max8997)
-{
- if (max8997->irq && max8997->irq_domain)
- max8997_irq_thread(0, max8997);
- return 0;
-}
-
-static int max8997_irq_domain_map(struct irq_domain *d, unsigned int irq,
- irq_hw_number_t hw)
-{
- struct max8997_dev *max8997 = d->host_data;
-
- irq_set_chip_data(irq, max8997);
- irq_set_chip_and_handler(irq, &max8997_irq_chip, handle_edge_irq);
- irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
- irq_set_noprobe(irq);
-#endif
- return 0;
-}
-
-static struct irq_domain_ops max8997_irq_domain_ops = {
- .map = max8997_irq_domain_map,
-};
-
-int max8997_irq_init(struct max8997_dev *max8997)
-{
- struct irq_domain *domain;
- int i;
- int ret;
- unsigned int val;
-
- if (!max8997->irq) {
- dev_warn(max8997->dev, "No interrupt specified.\n");
- return 0;
- }
-
- mutex_init(&max8997->irqlock);
-
- /* Mask individual interrupt sources */
- for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
- max8997->irq_masks_cur[i] = 0xff;
- max8997->irq_masks_cache[i] = 0xff;
-
- if (IS_ERR_OR_NULL(max8997->regmap))
- continue;
- if (max8997_mask_reg[i] == MAX8997_REG_INVALID)
- continue;
-
- regmap_write(max8997->regmap, max8997_mask_reg[i], 0xff);
- }
-
- for (i = 0; i < MAX8997_NUM_GPIO; i++) {
- max8997->gpio_status[i] = (regmap_read(max8997->regmap,
- MAX8997_REG_GPIOCNTL1 + i,
- &val)
- & MAX8997_GPIO_DATA_MASK) ?
- true : false;
- }
-
- domain = irq_domain_add_linear(NULL, MAX8997_IRQ_NR,
- &max8997_irq_domain_ops, max8997);
- if (!domain) {
- dev_err(max8997->dev, "could not create irq domain\n");
- return -ENODEV;
- }
- max8997->irq_domain = domain;
-
- ret = request_threaded_irq(max8997->irq, NULL, max8997_irq_thread,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
- "max8997-irq", max8997);
-
- if (ret) {
- dev_err(max8997->dev, "Failed to request IRQ %d: %d\n",
- max8997->irq, ret);
- return ret;
- }
-
- if (!max8997->ono)
- return 0;
-
- ret = request_threaded_irq(max8997->ono, NULL, max8997_irq_thread,
- IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING |
- IRQF_ONESHOT, "max8997-ono", max8997);
-
- if (ret)
- dev_err(max8997->dev, "Failed to request ono-IRQ %d: %d\n",
- max8997->ono, ret);
-
- return 0;
-}
-
-void max8997_irq_exit(struct max8997_dev *max8997)
-{
- if (max8997->ono)
- free_irq(max8997->ono, max8997);
-
- if (max8997->irq)
- free_irq(max8997->irq, max8997);
-}
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index ca6f310..9b6edfa 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -64,6 +64,49 @@ static const struct regmap_config max8997_regmap_config = {
.max_register = MAX8997_REG_PMIC_END,
};
+static const struct regmap_irq max8997_irqs[] = {
+ /* PMIC_INT1 interrupts */
+ { .reg_offset = 0, .mask = PMIC_INT1_PWRONR_MASK, },
+ { .reg_offset = 0, .mask = PMIC_INT1_PWRONF_MASK, },
+ { .reg_offset = 0, .mask = PMIC_INT1_PWRON1SEC_MASK, },
+ { .reg_offset = 0, .mask = PMIC_INT1_JIGONR_MASK, },
+ { .reg_offset = 0, .mask = PMIC_INT1_JIGONF_MASK, },
+ { .reg_offset = 0, .mask = PMIC_INT1_LOWBAT2_MASK, },
+ { .reg_offset = 0, .mask = PMIC_INT1_LOWBAT1_MASK, },
+ /* PMIC_INT2 interrupts */
+ { .reg_offset = 1, .mask = PMIC_INT2_JIGR_MASK, },
+ { .reg_offset = 1, .mask = PMIC_INT2_JIGF_MASK, },
+ { .reg_offset = 1, .mask = PMIC_INT2_MR_MASK, },
+ { .reg_offset = 1, .mask = PMIC_INT2_DVS1OK_MASK, },
+ { .reg_offset = 1, .mask = PMIC_INT2_DVS2OK_MASK, },
+ { .reg_offset = 1, .mask = PMIC_INT2_DVS3OK_MASK, },
+ { .reg_offset = 1, .mask = PMIC_INT2_DVS4OK_MASK, },
+ /* PMIC_INT3 interrupts */
+ { .reg_offset = 2, .mask = PMIC_INT3_CHGINS_MASK, },
+ { .reg_offset = 2, .mask = PMIC_INT3_CHGRM_MASK, },
+ { .reg_offset = 2, .mask = PMIC_INT3_DCINOVP_MASK, },
+ { .reg_offset = 2, .mask = PMIC_INT3_TOPOFFR_MASK, },
+ { .reg_offset = 2, .mask = PMIC_INT3_CHGRSTF_MASK, },
+ { .reg_offset = 2, .mask = PMIC_INT3_MBCHGTMEXPD_MASK, },
+ /* PMIC_INT4 interrupts */
+ { .reg_offset = 3, .mask = PMIC_INT4_RTC60S_MASK, },
+ { .reg_offset = 3, .mask = PMIC_INT4_RTCA1_MASK, },
+ { .reg_offset = 3, .mask = PMIC_INT4_RTCA2_MASK, },
+ { .reg_offset = 3, .mask = PMIC_INT4_SMPL_INT_MASK, },
+ { .reg_offset = 3, .mask = PMIC_INT4_RTC1S_MASK, },
+ { .reg_offset = 3, .mask = PMIC_INT4_WTSR_MASK, },
+};
+
+static const struct regmap_irq_chip max8997_irq_chip = {
+ .name = "max8997",
+ .status_base = MAX8997_REG_INT1,
+ .mask_base = MAX8997_REG_INT1MSK,
+ .mask_invert = false,
+ .num_regs = 4,
+ .irqs = max8997_irqs,
+ .num_irqs = ARRAY_SIZE(max8997_irqs),
+};
+
static const struct regmap_config max8997_regmap_rtc_config = {
.reg_bits = 8,
.val_bits = 8,
@@ -82,6 +125,31 @@ static const struct regmap_config max8997_regmap_muic_config = {
.max_register = MAX8997_MUIC_REG_END,
};
+static const struct regmap_irq max8997_irqs_muic[] = {
+ /* MUIC_INT1 interrupts */
+ { .reg_offset = 0, .mask = MUIC_INT1_ADC_MASK, },
+ { .reg_offset = 0, .mask = MUIC_INT1_ADCLow_MASK, },
+ { .reg_offset = 0, .mask = MUIC_INT1_ADCError_MASK, },
+ /* MUIC_INT2 interrupts */
+ { .reg_offset = 1, .mask = MUIC_INT2_ChgTyp_MASK, },
+ { .reg_offset = 1, .mask = MUIC_INT2_ChgDetRun_MASK, },
+ { .reg_offset = 1, .mask = MUIC_INT2_DCDTmr_MASK, },
+ { .reg_offset = 1, .mask = MUIC_INT2_DBChg_MASK, },
+ { .reg_offset = 1, .mask = MUIC_INT2_VBVolt_MASK, },
+ /* MUIC_INT3 interrupts */
+ { .reg_offset = 2, .mask = MUIC_INT3_OVP_MASK, },
+};
+
+static const struct regmap_irq_chip max8997_irq_chip_muic = {
+ .name = "max8997-muic",
+ .status_base = MAX8997_MUIC_REG_INT1,
+ .mask_base = MAX8997_MUIC_REG_INTMASK1,
+ .mask_invert = true,
+ .num_regs = 3,
+ .irqs = max8997_irqs_muic,
+ .num_irqs = ARRAY_SIZE(max8997_irqs_muic),
+};
+
/*
* Only the common platform data elements for max8997 are parsed here from the
* device tree. Other sub-modules of max8997 such as pmic, rtc and others have
@@ -173,6 +241,15 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
return ret;
}
+ ret = regmap_add_irq_chip(max8997->regmap, max8997->irq,
+ IRQF_ONESHOT | IRQF_SHARED |
+ IRQF_TRIGGER_FALLING, 0,
+ &max8997_irq_chip, &max8997->irq_data);
+ if (ret) {
+ dev_err(max8997->dev, "failed to add irq chip: %d\n", ret);
+ return ret;
+ }
+
max8997->regmap_rtc = devm_regmap_init_i2c(max8997->rtc,
&max8997_regmap_rtc_config);
if (IS_ERR(max8997->regmap_rtc)) {
@@ -200,9 +277,17 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
goto err_regmap;
}
- pm_runtime_set_active(max8997->dev);
+ ret = regmap_add_irq_chip(max8997->regmap_muic, max8997->irq,
+ IRQF_ONESHOT | IRQF_SHARED |
+ IRQF_TRIGGER_FALLING, 0,
+ &max8997_irq_chip_muic,
+ &max8997->irq_data_muic);
+ if (ret) {
+ dev_err(max8997->dev, "failed to add irq chip: %d\n", ret);
+ return ret;
+ }
- max8997_irq_init(max8997);
+ pm_runtime_set_active(max8997->dev);
ret = mfd_add_devices(max8997->dev, -1, max8997_devs,
ARRAY_SIZE(max8997_devs),
@@ -464,7 +549,7 @@ static int max8997_resume(struct device *dev)
if (device_may_wakeup(dev))
irq_set_irq_wake(max8997->irq, 0);
- return max8997_irq_resume(max8997);
+ return 0;
}
static const struct dev_pm_ops max8997_pm = {
diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
index b866f7d5..22769ea 100644
--- a/drivers/rtc/rtc-max8997.c
+++ b/drivers/rtc/rtc-max8997.c
@@ -494,7 +494,7 @@ static int max8997_rtc_probe(struct platform_device *pdev)
return ret;
}
- virq = irq_create_mapping(max8997->irq_domain, MAX8997_PMICIRQ_RTCA1);
+ virq = regmap_irq_get_virq(max8997->irq_data, MAX8997_PMICIRQ_RTCA1);
if (!virq) {
dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n");
ret = -ENXIO;
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index ea80ef8..af2f0aa 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -333,6 +333,48 @@ enum max8997_irq_source {
MAX8997_IRQ_GROUP_NR,
};
+#define PMIC_INT1_PWRONR_MASK (0x1 << 0)
+#define PMIC_INT1_PWRONF_MASK (0x1 << 1)
+#define PMIC_INT1_PWRON1SEC_MASK (0x1 << 3)
+#define PMIC_INT1_JIGONR_MASK (0x1 << 4)
+#define PMIC_INT1_JIGONF_MASK (0x1 << 5)
+#define PMIC_INT1_LOWBAT2_MASK (0x1 << 6)
+#define PMIC_INT1_LOWBAT1_MASK (0x1 << 7)
+
+#define PMIC_INT2_JIGR_MASK (0x1 << 0)
+#define PMIC_INT2_JIGF_MASK (0x1 << 1)
+#define PMIC_INT2_MR_MASK (0x1 << 2)
+#define PMIC_INT2_DVS1OK_MASK (0x1 << 3)
+#define PMIC_INT2_DVS2OK_MASK (0x1 << 4)
+#define PMIC_INT2_DVS3OK_MASK (0x1 << 5)
+#define PMIC_INT2_DVS4OK_MASK (0x1 << 6)
+
+#define PMIC_INT3_CHGINS_MASK (0x1 << 0)
+#define PMIC_INT3_CHGRM_MASK (0x1 << 1)
+#define PMIC_INT3_DCINOVP_MASK (0x1 << 2)
+#define PMIC_INT3_TOPOFFR_MASK (0x1 << 3)
+#define PMIC_INT3_CHGRSTF_MASK (0x1 << 5)
+#define PMIC_INT3_MBCHGTMEXPD_MASK (0x1 << 7)
+
+#define PMIC_INT4_RTC60S_MASK (0x1 << 0)
+#define PMIC_INT4_RTCA1_MASK (0x1 << 1)
+#define PMIC_INT4_RTCA2_MASK (0x1 << 2)
+#define PMIC_INT4_SMPL_INT_MASK (0x1 << 3)
+#define PMIC_INT4_RTC1S_MASK (0x1 << 4)
+#define PMIC_INT4_WTSR_MASK (0x1 << 5)
+
+#define MUIC_INT1_ADC_MASK (0x1 << 0)
+#define MUIC_INT1_ADCLow_MASK (0x1 << 1)
+#define MUIC_INT1_ADCError_MASK (0x1 << 2)
+
+#define MUIC_INT2_ChgTyp_MASK (0x1 << 0)
+#define MUIC_INT2_ChgDetRun_MASK (0x1 << 1)
+#define MUIC_INT2_DCDTmr_MASK (0x1 << 2)
+#define MUIC_INT2_DBChg_MASK (0x1 << 3)
+#define MUIC_INT2_VBVolt_MASK (0x1 << 4)
+
+#define MUIC_INT3_OVP_MASK (0x1 << 2)
+
enum max8997_irq {
MAX8997_PMICIRQ_PWRONR,
MAX8997_PMICIRQ_PWRONF,
@@ -364,19 +406,23 @@ enum max8997_irq {
MAX8997_PMICIRQ_RTC1S,
MAX8997_PMICIRQ_WTSR,
- MAX8997_MUICIRQ_ADCError,
- MAX8997_MUICIRQ_ADCLow,
+ MAX8997_PMICIRQ_NR,
+};
+
+enum max8997_irq_muic {
MAX8997_MUICIRQ_ADC,
+ MAX8997_MUICIRQ_ADCLow,
+ MAX8997_MUICIRQ_ADCError,
- MAX8997_MUICIRQ_VBVolt,
- MAX8997_MUICIRQ_DBChg,
- MAX8997_MUICIRQ_DCDTmr,
- MAX8997_MUICIRQ_ChgDetRun,
MAX8997_MUICIRQ_ChgTyp,
+ MAX8997_MUICIRQ_ChgDetRun,
+ MAX8997_MUICIRQ_DCDTmr,
+ MAX8997_MUICIRQ_DBChg,
+ MAX8997_MUICIRQ_VBVolt,
MAX8997_MUICIRQ_OVP,
- MAX8997_IRQ_NR,
+ MAX8997_MUCIRQ_NR,
};
#define MAX8997_NUM_GPIO 12
@@ -397,9 +443,10 @@ struct max8997_dev {
struct regmap *regmap_haptic;
struct regmap *regmap_muic;
+ struct regmap_irq_chip_data *irq_data;
+ struct regmap_irq_chip_data *irq_data_muic;
int irq;
int ono;
- struct irq_domain *irq_domain;
struct mutex irqlock;
int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
--
1.7.9.5
^ permalink raw reply related
* [PATCH 0/3] mfd: max8997: add regmap support
From: Robert Baldyga @ 2014-03-11 13:58 UTC (permalink / raw)
To: sameo, lee.jones
Cc: myungjoo.ham, cw00.choi, dmitry.torokhov, cooloney, rpurdie,
dbaryshkov, dwmw2, lgirdwood, broonie, a.zummo, paul.gortmaker,
linux-kernel, linux-input, linux-leds, rtc-linux, m.szyprowski,
k.kozlowski, Robert Baldyga
Hi,
This patchset modifies max8997 driver and associated function drivers to use
register maps instead of operating directly on i2c bus. This change allowed
to simplify irq handling, and to move some initializations to individual
function drivers. Hence now when some functions are not enabled, their i2c
clients, regmaps and irqs are not registered.
Best regards
Robert Baldyga
Samsung R&D Institute Poland
Robert Baldyga (3):
mfd: max8997: use regmap to access registers
mfd: max8997: handle IRQs using regmap
mfd: max8997: move regmap handling to function drivers
drivers/extcon/extcon-max8997.c | 136 ++++++++++--
drivers/input/misc/max8997_haptic.c | 117 +++++++++--
drivers/leds/leds-max8997.c | 13 +-
drivers/mfd/Makefile | 2 +-
drivers/mfd/max8997-irq.c | 387 -----------------------------------
drivers/mfd/max8997.c | 207 ++++++-------------
drivers/power/max8997_charger.c | 33 +--
drivers/regulator/max8997.c | 87 ++++----
drivers/rtc/rtc-max8997.c | 98 ++++++---
include/linux/mfd/max8997-private.h | 86 ++++++--
10 files changed, 482 insertions(+), 684 deletions(-)
delete mode 100644 drivers/mfd/max8997-irq.c
--
1.7.9.5
^ permalink raw reply
* [PATCH 3/3] mfd: max8997: move regmap handling to function drivers
From: Robert Baldyga @ 2014-03-11 13:58 UTC (permalink / raw)
To: sameo, lee.jones
Cc: myungjoo.ham, cw00.choi, dmitry.torokhov, cooloney, rpurdie,
dbaryshkov, dwmw2, lgirdwood, broonie, a.zummo, paul.gortmaker,
linux-kernel, linux-input, linux-leds, rtc-linux, m.szyprowski,
k.kozlowski, Robert Baldyga
In-Reply-To: <1394546304-15191-1-git-send-email-r.baldyga@samsung.com>
This patch moves code creating new i2c clients and regmaps to function
drivers which uses them. It allow to avoid creating this instances when
intividual function drivers are not enabled.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
drivers/extcon/extcon-max8997.c | 118 +++++++++++++++++++++++++++--
drivers/input/misc/max8997_haptic.c | 113 ++++++++++++++++++++++-----
drivers/mfd/max8997.c | 143 -----------------------------------
drivers/rtc/rtc-max8997.c | 74 ++++++++++++------
include/linux/mfd/max8997-private.h | 14 ++--
5 files changed, 262 insertions(+), 200 deletions(-)
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 5948061..a71581a 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -118,6 +118,9 @@ enum max8997_muic_charger_type {
struct max8997_muic_info {
struct device *dev;
struct max8997_dev *max8997;
+ struct i2c_client *i2c;
+ struct regmap *regmap;
+ struct regmap_irq_chip_data *irq_data;
struct extcon_dev *edev;
int prev_cable_type;
int prev_chg_type;
@@ -144,6 +147,39 @@ struct max8997_muic_info {
*/
int path_usb;
int path_uart;
+
+ unsigned int reg_dump[MAX8997_MUIC_REG_END];
+};
+
+static const struct regmap_config max8997_muic_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = MAX8997_MUIC_REG_END,
+};
+
+static const struct regmap_irq max8997_irqs_muic[] = {
+ /* MUIC_INT1 interrupts */
+ { .reg_offset = 0, .mask = MUIC_INT1_ADC_MASK, },
+ { .reg_offset = 0, .mask = MUIC_INT1_ADCLow_MASK, },
+ { .reg_offset = 0, .mask = MUIC_INT1_ADCError_MASK, },
+ /* MUIC_INT2 interrupts */
+ { .reg_offset = 1, .mask = MUIC_INT2_ChgTyp_MASK, },
+ { .reg_offset = 1, .mask = MUIC_INT2_ChgDetRun_MASK, },
+ { .reg_offset = 1, .mask = MUIC_INT2_DCDTmr_MASK, },
+ { .reg_offset = 1, .mask = MUIC_INT2_DBChg_MASK, },
+ { .reg_offset = 1, .mask = MUIC_INT2_VBVolt_MASK, },
+ /* MUIC_INT3 interrupts */
+ { .reg_offset = 2, .mask = MUIC_INT3_OVP_MASK, },
+};
+
+static const struct regmap_irq_chip max8997_muic_irq_chip = {
+ .name = "max8997-muic",
+ .status_base = MAX8997_MUIC_REG_INT1,
+ .mask_base = MAX8997_MUIC_REG_INTMASK1,
+ .mask_invert = true,
+ .num_regs = 3,
+ .irqs = max8997_irqs_muic,
+ .num_irqs = ARRAY_SIZE(max8997_irqs_muic),
};
enum {
@@ -191,7 +227,7 @@ static int max8997_muic_set_debounce_time(struct max8997_muic_info *info,
case ADC_DEBOUNCE_TIME_10MS:
case ADC_DEBOUNCE_TIME_25MS:
case ADC_DEBOUNCE_TIME_38_62MS:
- ret = regmap_update_bits(info->max8997->regmap_muic,
+ ret = regmap_update_bits(info->regmap,
MAX8997_MUIC_REG_CONTROL3,
CONTROL3_ADCDBSET_MASK,
time << CONTROL3_ADCDBSET_SHIFT);
@@ -229,7 +265,7 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
else
ctrl1 = CONTROL1_SW_OPEN;
- ret = regmap_update_bits(info->max8997->regmap_muic,
+ ret = regmap_update_bits(info->regmap,
MAX8997_MUIC_REG_CONTROL1, COMP_SW_MASK, ctrl1);
if (ret < 0) {
dev_err(info->dev, "failed to update MUIC register\n");
@@ -241,7 +277,7 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
else
ctrl2 |= CONTROL2_LOWPWR_MASK; /* LowPwr=1, CPEn=0 */
- ret = regmap_update_bits(info->max8997->regmap_muic,
+ ret = regmap_update_bits(info->regmap,
MAX8997_MUIC_REG_CONTROL2,
CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK, ctrl2);
if (ret < 0) {
@@ -544,7 +580,7 @@ static void max8997_muic_irq_work(struct work_struct *work)
if (info->irq == muic_irqs[i].virq)
irq_type = muic_irqs[i].irq;
- ret = regmap_bulk_read(info->max8997->regmap_muic,
+ ret = regmap_bulk_read(info->regmap,
MAX8997_MUIC_REG_STATUS1, info->status, 2);
if (ret) {
dev_err(info->dev, "failed to read muic register\n");
@@ -606,7 +642,7 @@ static int max8997_muic_detect_dev(struct max8997_muic_info *info)
mutex_lock(&info->mutex);
/* Read STATUSx register to detect accessory */
- ret = regmap_bulk_read(info->max8997->regmap_muic,
+ ret = regmap_bulk_read(info->regmap,
MAX8997_MUIC_REG_STATUS1, info->status, 2);
if (ret) {
dev_err(info->dev, "failed to read MUIC register\n");
@@ -670,6 +706,27 @@ static int max8997_muic_probe(struct platform_device *pdev)
info->dev = &pdev->dev;
info->max8997 = max8997;
+ info->i2c = i2c_new_dummy(max8997->i2c->adapter, MAX8997_I2C_ADDR_MUIC);
+
+ info->regmap = devm_regmap_init_i2c(info->i2c,
+ &max8997_muic_regmap_config);
+ if (IS_ERR(info->regmap)) {
+ ret = PTR_ERR(info->regmap);
+ dev_err(info->dev,
+ "failed to allocate register map: %d\n", ret);
+ goto err_regmap;
+ }
+
+ ret = regmap_add_irq_chip(info->regmap, max8997->irq,
+ IRQF_ONESHOT | IRQF_SHARED |
+ IRQF_TRIGGER_FALLING, 0,
+ &max8997_muic_irq_chip,
+ &info->irq_data);
+ if (ret) {
+ dev_err(info->dev, "failed to add irq chip: %d\n", ret);
+ goto err_regmap;
+ }
+
platform_set_drvdata(pdev, info);
mutex_init(&info->mutex);
@@ -679,8 +736,7 @@ static int max8997_muic_probe(struct platform_device *pdev)
struct max8997_muic_irq *muic_irq = &muic_irqs[i];
unsigned int virq = 0;
- virq = regmap_irq_get_virq(max8997->irq_data_muic,
- muic_irq->irq);
+ virq = regmap_irq_get_virq(info->irq_data, muic_irq->irq);
if (!virq) {
ret = -EINVAL;
goto err_irq;
@@ -723,7 +779,7 @@ static int max8997_muic_probe(struct platform_device *pdev)
/* Initialize registers according to platform data */
for (i = 0; i < muic_pdata->num_init_data; i++) {
- regmap_write(info->max8997->regmap_muic,
+ regmap_write(info->regmap,
muic_pdata->init_data[i].addr,
muic_pdata->init_data[i].data);
}
@@ -779,6 +835,8 @@ static int max8997_muic_probe(struct platform_device *pdev)
err_irq:
while (--i >= 0)
free_irq(muic_irqs[i].virq, info);
+err_regmap:
+ i2c_unregister_device(info->i2c);
return ret;
}
@@ -796,10 +854,54 @@ static int max8997_muic_remove(struct platform_device *pdev)
return 0;
}
+static u8 max8997_muic_dumpaddr[] = {
+ MAX8997_MUIC_REG_INTMASK1,
+ MAX8997_MUIC_REG_INTMASK2,
+ MAX8997_MUIC_REG_INTMASK3,
+ MAX8997_MUIC_REG_CDETCTRL,
+ MAX8997_MUIC_REG_CONTROL1,
+ MAX8997_MUIC_REG_CONTROL2,
+ MAX8997_MUIC_REG_CONTROL3,
+};
+
+static int max8997_muic_freeze(struct device *dev)
+{
+ struct platform_device *pdev =
+ container_of(dev, struct platform_device, dev);
+ struct max8997_muic_info *info = platform_get_drvdata(pdev);
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(max8997_muic_dumpaddr); i++)
+ regmap_read(info->regmap, max8997_muic_dumpaddr[i],
+ &info->reg_dump[i]);
+
+ return 0;
+}
+
+static int max8997_muic_restore(struct device *dev)
+{
+ struct platform_device *pdev =
+ container_of(dev, struct platform_device, dev);
+ struct max8997_muic_info *info = platform_get_drvdata(pdev);
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(max8997_muic_dumpaddr); i++)
+ regmap_write(info->regmap, max8997_muic_dumpaddr[i],
+ info->reg_dump[i]);
+
+ return 0;
+}
+
+static const struct dev_pm_ops max8997_muic_pm = {
+ .freeze = max8997_muic_freeze,
+ .restore = max8997_muic_restore,
+};
+
static struct platform_driver max8997_muic_driver = {
.driver = {
.name = DEV_NAME,
.owner = THIS_MODULE,
+ .pm = &max8997_muic_pm,
},
.probe = max8997_muic_probe,
.remove = max8997_muic_remove,
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index d3f7079..abb44f3 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -47,6 +47,8 @@
struct max8997_haptic {
struct device *dev;
struct max8997_dev *max8997;
+ struct i2c_client *i2c;
+ struct regmap *regmap;
struct input_dev *input_dev;
struct regulator *regulator;
@@ -66,6 +68,14 @@ struct max8997_haptic {
unsigned int internal_mode_pattern;
unsigned int pattern_cycle;
unsigned int pattern_signal_period;
+
+ unsigned int reg_dump[MAX8997_HAPTIC_REG_END];
+};
+
+static const struct regmap_config max8997_haptic_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = MAX8997_HAPTIC_REG_END,
};
static int max8997_haptic_set_duty_cycle(struct max8997_haptic *chip)
@@ -87,19 +97,19 @@ static int max8997_haptic_set_duty_cycle(struct max8997_haptic *chip)
}
switch (chip->internal_mode_pattern) {
case 0:
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_SIGPWMDC1, duty_index);
break;
case 1:
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_SIGPWMDC2, duty_index);
break;
case 2:
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_SIGPWMDC3, duty_index);
break;
case 3:
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_SIGPWMDC4, duty_index);
break;
default:
@@ -116,51 +126,49 @@ static void max8997_haptic_configure(struct max8997_haptic *chip)
value = chip->type << MAX8997_MOTOR_TYPE_SHIFT |
chip->enabled << MAX8997_ENABLE_SHIFT |
chip->mode << MAX8997_MODE_SHIFT | chip->pwm_divisor;
- regmap_write(chip->max8997->regmap_haptic,
- MAX8997_HAPTIC_REG_CONF2, value);
+ regmap_write(chip->regmap, MAX8997_HAPTIC_REG_CONF2, value);
if (chip->mode == MAX8997_INTERNAL_MODE && chip->enabled) {
value = chip->internal_mode_pattern << MAX8997_CYCLE_SHIFT |
chip->internal_mode_pattern << MAX8997_SIG_PERIOD_SHIFT |
chip->internal_mode_pattern << MAX8997_SIG_DUTY_SHIFT |
chip->internal_mode_pattern << MAX8997_PWM_DUTY_SHIFT;
- regmap_write(chip->max8997->regmap_haptic,
- MAX8997_HAPTIC_REG_DRVCONF, value);
+ regmap_write(chip->regmap, MAX8997_HAPTIC_REG_DRVCONF, value);
switch (chip->internal_mode_pattern) {
case 0:
value = chip->pattern_cycle << 4;
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_CYCLECONF1, value);
value = chip->pattern_signal_period;
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_SIGCONF1, value);
break;
case 1:
value = chip->pattern_cycle;
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_CYCLECONF1, value);
value = chip->pattern_signal_period;
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_SIGCONF2, value);
break;
case 2:
value = chip->pattern_cycle << 4;
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_CYCLECONF2, value);
value = chip->pattern_signal_period;
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_SIGCONF3, value);
break;
case 3:
value = chip->pattern_cycle;
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_CYCLECONF2, value);
value = chip->pattern_signal_period;
- regmap_write(chip->max8997->regmap_haptic,
+ regmap_write(chip->regmap,
MAX8997_HAPTIC_REG_SIGCONF4, value);
break;
@@ -277,6 +285,17 @@ static int max8997_haptic_probe(struct platform_device *pdev)
chip->mode = haptic_pdata->mode;
chip->pwm_divisor = haptic_pdata->pwm_divisor;
+ chip->i2c = i2c_new_dummy(iodev->i2c->adapter, MAX8997_I2C_ADDR_HAPTIC);
+
+ chip->regmap = devm_regmap_init_i2c(chip->i2c,
+ &max8997_haptic_regmap_config);
+ if (IS_ERR(chip->regmap)) {
+ error = PTR_ERR(chip->regmap);
+ dev_err(chip->dev,
+ "failed to allocate register map: %d\n", error);
+ goto err_free_i2c;
+ }
+
switch (chip->mode) {
case MAX8997_INTERNAL_MODE:
chip->internal_mode_pattern =
@@ -294,7 +313,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
dev_err(&pdev->dev,
"unable to request PWM for haptic, error: %d\n",
error);
- goto err_free_mem;
+ goto err_free_i2c;
}
break;
@@ -302,7 +321,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
dev_err(&pdev->dev,
"Invalid chip mode specified (%d)\n", chip->mode);
error = -EINVAL;
- goto err_free_mem;
+ goto err_free_i2c;
}
chip->regulator = regulator_get(&pdev->dev, "inmotor");
@@ -348,6 +367,8 @@ err_put_regulator:
err_free_pwm:
if (chip->mode == MAX8997_EXTERNAL_MODE)
pwm_free(chip->pwm);
+err_free_i2c:
+ i2c_unregister_device(chip->i2c);
err_free_mem:
input_free_device(input_dev);
kfree(chip);
@@ -370,6 +391,24 @@ static int max8997_haptic_remove(struct platform_device *pdev)
return 0;
}
+static u8 max8997_haptic_dumpaddr[] = {
+ MAX8997_HAPTIC_REG_CONF1,
+ MAX8997_HAPTIC_REG_CONF2,
+ MAX8997_HAPTIC_REG_DRVCONF,
+ MAX8997_HAPTIC_REG_CYCLECONF1,
+ MAX8997_HAPTIC_REG_CYCLECONF2,
+ MAX8997_HAPTIC_REG_SIGCONF1,
+ MAX8997_HAPTIC_REG_SIGCONF2,
+ MAX8997_HAPTIC_REG_SIGCONF3,
+ MAX8997_HAPTIC_REG_SIGCONF4,
+ MAX8997_HAPTIC_REG_SIGDC1,
+ MAX8997_HAPTIC_REG_SIGDC2,
+ MAX8997_HAPTIC_REG_SIGPWMDC1,
+ MAX8997_HAPTIC_REG_SIGPWMDC2,
+ MAX8997_HAPTIC_REG_SIGPWMDC3,
+ MAX8997_HAPTIC_REG_SIGPWMDC4,
+};
+
#ifdef CONFIG_PM_SLEEP
static int max8997_haptic_suspend(struct device *dev)
{
@@ -382,7 +421,41 @@ static int max8997_haptic_suspend(struct device *dev)
}
#endif
-static SIMPLE_DEV_PM_OPS(max8997_haptic_pm_ops, max8997_haptic_suspend, NULL);
+static int max8997_haptic_freeze(struct device *dev)
+{
+ struct platform_device *pdev =
+ container_of(dev, struct platform_device, dev);
+ struct max8997_haptic *chip = platform_get_drvdata(pdev);
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(max8997_haptic_dumpaddr); i++)
+ regmap_read(chip->regmap, max8997_haptic_dumpaddr[i],
+ &chip->reg_dump[i]);
+
+ return 0;
+}
+
+static int max8997_haptic_restore(struct device *dev)
+{
+ struct platform_device *pdev =
+ container_of(dev, struct platform_device, dev);
+ struct max8997_haptic *chip = platform_get_drvdata(pdev);
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(max8997_haptic_dumpaddr); i++)
+ regmap_write(chip->regmap, max8997_haptic_dumpaddr[i],
+ chip->reg_dump[i]);
+
+ return 0;
+}
+
+static const struct dev_pm_ops max8997_haptic_pm = {
+#ifdef CONFIG_PM_SLEEP
+ .suspend = max8997_haptic_suspend,
+#endif
+ .freeze = max8997_haptic_freeze,
+ .restore = max8997_haptic_restore,
+};
static const struct platform_device_id max8997_haptic_id[] = {
{ "max8997-haptic", 0 },
@@ -394,7 +467,7 @@ static struct platform_driver max8997_haptic_driver = {
.driver = {
.name = "max8997-haptic",
.owner = THIS_MODULE,
- .pm = &max8997_haptic_pm_ops,
+ .pm = &max8997_haptic_pm,
},
.probe = max8997_haptic_probe,
.remove = max8997_haptic_remove,
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index 9b6edfa..d36066d 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -35,12 +35,6 @@
#include <linux/mfd/max8997-private.h>
#include <linux/regmap.h>
-#define I2C_ADDR_PMIC (0xCC >> 1)
-#define I2C_ADDR_MUIC (0x4A >> 1)
-#define I2C_ADDR_BATTERY (0x6C >> 1)
-#define I2C_ADDR_RTC (0x0C >> 1)
-#define I2C_ADDR_HAPTIC (0x90 >> 1)
-
static const struct mfd_cell max8997_devs[] = {
{ .name = "max8997-pmic", },
{ .name = "max8997-rtc", },
@@ -107,48 +101,6 @@ static const struct regmap_irq_chip max8997_irq_chip = {
.num_irqs = ARRAY_SIZE(max8997_irqs),
};
-static const struct regmap_config max8997_regmap_rtc_config = {
- .reg_bits = 8,
- .val_bits = 8,
- .max_register = MAX8997_RTC_REG_END,
-};
-
-static const struct regmap_config max8997_regmap_haptic_config = {
- .reg_bits = 8,
- .val_bits = 8,
- .max_register = MAX8997_HAPTIC_REG_END,
-};
-
-static const struct regmap_config max8997_regmap_muic_config = {
- .reg_bits = 8,
- .val_bits = 8,
- .max_register = MAX8997_MUIC_REG_END,
-};
-
-static const struct regmap_irq max8997_irqs_muic[] = {
- /* MUIC_INT1 interrupts */
- { .reg_offset = 0, .mask = MUIC_INT1_ADC_MASK, },
- { .reg_offset = 0, .mask = MUIC_INT1_ADCLow_MASK, },
- { .reg_offset = 0, .mask = MUIC_INT1_ADCError_MASK, },
- /* MUIC_INT2 interrupts */
- { .reg_offset = 1, .mask = MUIC_INT2_ChgTyp_MASK, },
- { .reg_offset = 1, .mask = MUIC_INT2_ChgDetRun_MASK, },
- { .reg_offset = 1, .mask = MUIC_INT2_DCDTmr_MASK, },
- { .reg_offset = 1, .mask = MUIC_INT2_DBChg_MASK, },
- { .reg_offset = 1, .mask = MUIC_INT2_VBVolt_MASK, },
- /* MUIC_INT3 interrupts */
- { .reg_offset = 2, .mask = MUIC_INT3_OVP_MASK, },
-};
-
-static const struct regmap_irq_chip max8997_irq_chip_muic = {
- .name = "max8997-muic",
- .status_base = MAX8997_MUIC_REG_INT1,
- .mask_base = MAX8997_MUIC_REG_INTMASK1,
- .mask_invert = true,
- .num_regs = 3,
- .irqs = max8997_irqs_muic,
- .num_irqs = ARRAY_SIZE(max8997_irqs_muic),
-};
/*
* Only the common platform data elements for max8997 are parsed here from the
@@ -224,15 +176,6 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
mutex_init(&max8997->iolock);
- max8997->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC);
- i2c_set_clientdata(max8997->rtc, max8997);
-
- max8997->haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC);
- i2c_set_clientdata(max8997->haptic, max8997);
-
- max8997->muic = i2c_new_dummy(i2c->adapter, I2C_ADDR_MUIC);
- i2c_set_clientdata(max8997->muic, max8997);
-
max8997->regmap = devm_regmap_init_i2c(i2c, &max8997_regmap_config);
if (IS_ERR(max8997->regmap)) {
ret = PTR_ERR(max8997->regmap);
@@ -250,43 +193,10 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
return ret;
}
- max8997->regmap_rtc = devm_regmap_init_i2c(max8997->rtc,
- &max8997_regmap_rtc_config);
- if (IS_ERR(max8997->regmap_rtc)) {
- ret = PTR_ERR(max8997->regmap_rtc);
- dev_err(max8997->dev,
- "failed to allocate register map: %d\n", ret);
- goto err_regmap;
- }
-
- max8997->regmap_haptic = devm_regmap_init_i2c(max8997->haptic,
- &max8997_regmap_haptic_config);
- if (IS_ERR(max8997->regmap_haptic)) {
- ret = PTR_ERR(max8997->regmap_haptic);
- dev_err(max8997->dev,
- "failed to allocate register map: %d\n", ret);
- goto err_regmap;
- }
-
- max8997->regmap_muic = devm_regmap_init_i2c(max8997->muic,
- &max8997_regmap_muic_config);
- if (IS_ERR(max8997->regmap_muic)) {
- ret = PTR_ERR(max8997->regmap_muic);
- dev_err(max8997->dev,
- "failed to allocate register map: %d\n", ret);
- goto err_regmap;
- }
-
- ret = regmap_add_irq_chip(max8997->regmap_muic, max8997->irq,
- IRQF_ONESHOT | IRQF_SHARED |
- IRQF_TRIGGER_FALLING, 0,
- &max8997_irq_chip_muic,
- &max8997->irq_data_muic);
if (ret) {
dev_err(max8997->dev, "failed to add irq chip: %d\n", ret);
return ret;
}
-
pm_runtime_set_active(max8997->dev);
ret = mfd_add_devices(max8997->dev, -1, max8997_devs,
@@ -309,10 +219,6 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
err_mfd:
mfd_remove_devices(max8997->dev);
-err_regmap:
- i2c_unregister_device(max8997->muic);
- i2c_unregister_device(max8997->haptic);
- i2c_unregister_device(max8997->rtc);
return ret;
}
@@ -321,9 +227,6 @@ static int max8997_i2c_remove(struct i2c_client *i2c)
struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
mfd_remove_devices(max8997->dev);
- i2c_unregister_device(max8997->muic);
- i2c_unregister_device(max8997->haptic);
- i2c_unregister_device(max8997->rtc);
return 0;
}
@@ -460,34 +363,6 @@ static u8 max8997_dumpaddr_pmic[] = {
MAX8997_REG_DVSOKTIMER5,
};
-static u8 max8997_dumpaddr_muic[] = {
- MAX8997_MUIC_REG_INTMASK1,
- MAX8997_MUIC_REG_INTMASK2,
- MAX8997_MUIC_REG_INTMASK3,
- MAX8997_MUIC_REG_CDETCTRL,
- MAX8997_MUIC_REG_CONTROL1,
- MAX8997_MUIC_REG_CONTROL2,
- MAX8997_MUIC_REG_CONTROL3,
-};
-
-static u8 max8997_dumpaddr_haptic[] = {
- MAX8997_HAPTIC_REG_CONF1,
- MAX8997_HAPTIC_REG_CONF2,
- MAX8997_HAPTIC_REG_DRVCONF,
- MAX8997_HAPTIC_REG_CYCLECONF1,
- MAX8997_HAPTIC_REG_CYCLECONF2,
- MAX8997_HAPTIC_REG_SIGCONF1,
- MAX8997_HAPTIC_REG_SIGCONF2,
- MAX8997_HAPTIC_REG_SIGCONF3,
- MAX8997_HAPTIC_REG_SIGCONF4,
- MAX8997_HAPTIC_REG_SIGDC1,
- MAX8997_HAPTIC_REG_SIGDC2,
- MAX8997_HAPTIC_REG_SIGPWMDC1,
- MAX8997_HAPTIC_REG_SIGPWMDC2,
- MAX8997_HAPTIC_REG_SIGPWMDC3,
- MAX8997_HAPTIC_REG_SIGPWMDC4,
-};
-
static int max8997_freeze(struct device *dev)
{
struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
@@ -498,15 +373,6 @@ static int max8997_freeze(struct device *dev)
regmap_read(max8997->regmap, max8997_dumpaddr_pmic[i],
&max8997->reg_dump[i]);
- for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_muic); i++)
- regmap_read(max8997->regmap_muic, max8997_dumpaddr_muic[i],
- &max8997->reg_dump[i + MAX8997_REG_PMIC_END]);
-
- for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_haptic); i++)
- regmap_read(max8997->regmap_haptic, max8997_dumpaddr_haptic[i],
- &max8997->reg_dump[i + MAX8997_REG_PMIC_END +
- MAX8997_MUIC_REG_END]);
-
return 0;
}
@@ -520,15 +386,6 @@ static int max8997_restore(struct device *dev)
regmap_write(max8997->regmap, max8997_dumpaddr_pmic[i],
max8997->reg_dump[i]);
- for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_muic); i++)
- regmap_write(max8997->regmap_muic, max8997_dumpaddr_muic[i],
- max8997->reg_dump[i + MAX8997_REG_PMIC_END]);
-
- for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_haptic); i++)
- regmap_write(max8997->regmap_haptic, max8997_dumpaddr_haptic[i],
- max8997->reg_dump[i + MAX8997_REG_PMIC_END +
- MAX8997_MUIC_REG_END]);
-
return 0;
}
diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
index 22769ea..1786da4 100644
--- a/drivers/rtc/rtc-max8997.c
+++ b/drivers/rtc/rtc-max8997.c
@@ -69,12 +69,20 @@ enum {
struct max8997_rtc_info {
struct device *dev;
struct max8997_dev *max8997;
+ struct i2c_client *i2c;
+ struct regmap *regmap;
struct rtc_device *rtc_dev;
struct mutex lock;
int virq;
int rtc_24hr_mode;
};
+static const struct regmap_config max8997_rtc_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = MAX8997_RTC_REG_END,
+};
+
static void max8997_rtc_data_to_tm(u8 *data, struct rtc_time *tm,
int rtc_24hr_mode)
{
@@ -118,8 +126,7 @@ static inline int max8997_rtc_set_update_reg(struct max8997_rtc_info *info)
{
int ret;
- ret = regmap_write(info->max8997->regmap_rtc,
- MAX8997_RTC_UPDATE1, RTC_UDR_MASK);
+ ret = regmap_write(info->regmap, MAX8997_RTC_UPDATE1, RTC_UDR_MASK);
if (ret < 0)
dev_err(info->dev, "%s: fail to write update reg(%d)\n",
__func__, ret);
@@ -140,7 +147,7 @@ static int max8997_rtc_read_time(struct device *dev, struct rtc_time *tm)
int ret;
mutex_lock(&info->lock);
- ret = regmap_bulk_read(info->max8997->regmap_rtc,
+ ret = regmap_bulk_read(info->regmap,
MAX8997_RTC_SEC, data, RTC_NR_TIME);
mutex_unlock(&info->lock);
@@ -167,7 +174,7 @@ static int max8997_rtc_set_time(struct device *dev, struct rtc_time *tm)
mutex_lock(&info->lock);
- ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ ret = regmap_bulk_write(info->regmap,
MAX8997_RTC_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write time reg(%d)\n", __func__,
@@ -190,7 +197,7 @@ static int max8997_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
mutex_lock(&info->lock);
- ret = regmap_bulk_read(info->max8997->regmap_rtc,
+ ret = regmap_bulk_read(info->regmap,
MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s:%d fail to read alarm reg(%d)\n",
@@ -209,8 +216,7 @@ static int max8997_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
}
alrm->pending = 0;
- ret = regmap_read(info->max8997->regmap_rtc,
- MAX8997_REG_STATUS1, &val);
+ ret = regmap_read(info->regmap, MAX8997_REG_STATUS1, &val);
if (ret < 0) {
dev_err(info->dev, "%s:%d fail to read status1 reg(%d)\n",
__func__, __LINE__, ret);
@@ -233,7 +239,7 @@ static int max8997_rtc_stop_alarm(struct max8997_rtc_info *info)
if (!mutex_is_locked(&info->lock))
dev_warn(info->dev, "%s: should have mutex locked\n", __func__);
- ret = regmap_bulk_read(info->max8997->regmap_rtc,
+ ret = regmap_bulk_read(info->regmap,
MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to read alarm reg(%d)\n",
@@ -244,7 +250,7 @@ static int max8997_rtc_stop_alarm(struct max8997_rtc_info *info)
for (i = 0; i < RTC_NR_TIME; i++)
data[i] &= ~ALARM_ENABLE_MASK;
- ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ ret = regmap_bulk_write(info->regmap,
MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
@@ -265,7 +271,7 @@ static int max8997_rtc_start_alarm(struct max8997_rtc_info *info)
if (!mutex_is_locked(&info->lock))
dev_warn(info->dev, "%s: should have mutex locked\n", __func__);
- ret = regmap_bulk_read(info->max8997->regmap_rtc,
+ ret = regmap_bulk_read(info->regmap,
MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to read alarm reg(%d)\n",
@@ -284,7 +290,7 @@ static int max8997_rtc_start_alarm(struct max8997_rtc_info *info)
if (data[RTC_DATE] & 0x1f)
data[RTC_DATE] |= (1 << ALARM_ENABLE_SHIFT);
- ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ ret = regmap_bulk_write(info->regmap,
MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
@@ -316,7 +322,7 @@ static int max8997_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
if (ret < 0)
goto out;
- ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ ret = regmap_bulk_write(info->regmap,
MAX8997_RTC_ALARM1_SEC, data, RTC_NR_TIME);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
@@ -388,7 +394,7 @@ static void max8997_rtc_enable_wtsr(struct max8997_rtc_info *info, bool enable)
dev_info(info->dev, "%s: %s WTSR\n", __func__,
enable ? "enable" : "disable");
- ret = regmap_update_bits(info->max8997->regmap_rtc,
+ ret = regmap_update_bits(info->regmap,
MAX8997_RTC_WTSR_SMPL, mask, val);
if (ret < 0) {
dev_err(info->dev, "%s: fail to update WTSR reg(%d)\n",
@@ -417,7 +423,7 @@ static void max8997_rtc_enable_smpl(struct max8997_rtc_info *info, bool enable)
dev_info(info->dev, "%s: %s SMPL\n", __func__,
enable ? "enable" : "disable");
- ret = regmap_update_bits(info->max8997->regmap_rtc,
+ ret = regmap_update_bits(info->regmap,
MAX8997_RTC_WTSR_SMPL, mask, val);
if (ret < 0) {
dev_err(info->dev, "%s: fail to update SMPL reg(%d)\n",
@@ -428,8 +434,7 @@ static void max8997_rtc_enable_smpl(struct max8997_rtc_info *info, bool enable)
max8997_rtc_set_update_reg(info);
val = 0;
- regmap_read(info->max8997->regmap_rtc,
- MAX8997_RTC_WTSR_SMPL, &val);
+ regmap_read(info->regmap, MAX8997_RTC_WTSR_SMPL, &val);
pr_info("%s: WTSR_SMPL(0x%02x)\n", __func__, val);
}
@@ -444,7 +449,7 @@ static int max8997_rtc_init_reg(struct max8997_rtc_info *info)
info->rtc_24hr_mode = 1;
- ret = regmap_bulk_write(info->max8997->regmap_rtc,
+ ret = regmap_bulk_write(info->regmap,
MAX8997_RTC_CTRLMASK, data, 2);
if (ret < 0) {
dev_err(info->dev, "%s: fail to write controlm reg(%d)\n",
@@ -471,13 +476,24 @@ static int max8997_rtc_probe(struct platform_device *pdev)
info->dev = &pdev->dev;
info->max8997 = max8997;
+ info->i2c = i2c_new_dummy(max8997->i2c->adapter, MAX8997_I2C_ADDR_RTC);
+
+ info->regmap = devm_regmap_init_i2c(info->i2c,
+ &max8997_rtc_regmap_config);
+ if (IS_ERR(info->regmap)) {
+ ret = PTR_ERR(info->regmap);
+ dev_err(info->dev,
+ "failed to allocate register map: %d\n", ret);
+ goto err_regmap;
+ }
+
platform_set_drvdata(pdev, info);
ret = max8997_rtc_init_reg(info);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to initialize RTC reg:%d\n", ret);
- return ret;
+ goto err_regmap;
}
max8997_rtc_enable_wtsr(info, true);
@@ -491,28 +507,41 @@ static int max8997_rtc_probe(struct platform_device *pdev)
if (IS_ERR(info->rtc_dev)) {
ret = PTR_ERR(info->rtc_dev);
dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
- return ret;
+ goto err_regmap;
}
virq = regmap_irq_get_virq(max8997->irq_data, MAX8997_PMICIRQ_RTCA1);
if (!virq) {
dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n");
ret = -ENXIO;
- goto err_out;
+ goto err_regmap;
}
info->virq = virq;
ret = devm_request_threaded_irq(&pdev->dev, virq, NULL,
max8997_rtc_alarm_irq, 0,
"rtc-alarm0", info);
- if (ret < 0)
+ if (ret < 0) {
dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
info->virq, ret);
+ goto err_regmap;
+ }
+
+ return ret;
-err_out:
+err_regmap:
+ i2c_unregister_device(info->i2c);
return ret;
}
+static int max8997_rtc_remove(struct platform_device *pdev)
+{
+ struct max8997_rtc_info *info = platform_get_drvdata(pdev);
+ i2c_unregister_device(info->i2c);
+
+ return 0;
+}
+
static void max8997_rtc_shutdown(struct platform_device *pdev)
{
struct max8997_rtc_info *info = platform_get_drvdata(pdev);
@@ -532,6 +561,7 @@ static struct platform_driver max8997_rtc_driver = {
.owner = THIS_MODULE,
},
.probe = max8997_rtc_probe,
+ .remove = max8997_rtc_remove,
.shutdown = max8997_rtc_shutdown,
.id_table = rtc_id,
};
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index af2f0aa..612a295 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -26,6 +26,13 @@
#include <linux/export.h>
#include <linux/irqdomain.h>
+#define MAX8997_I2C_ADDR_PMIC (0xCC >> 1)
+#define MAX8997_I2C_ADDR_MUIC (0x4A >> 1)
+#define MAX8997_I2C_ADDR_BATTERY (0x6C >> 1)
+#define MAX8997_I2C_ADDR_RTC (0x0C >> 1)
+#define MAX8997_I2C_ADDR_HAPTIC (0x90 >> 1)
+
+
#define MAX8997_REG_INVALID (0xff)
enum max8997_pmic_reg {
@@ -430,21 +437,14 @@ struct max8997_dev {
struct device *dev;
struct max8997_platform_data *pdata;
struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */
- struct i2c_client *rtc; /* slave addr 0x0c */
- struct i2c_client *haptic; /* slave addr 0x90 */
- struct i2c_client *muic; /* slave addr 0x4a */
struct mutex iolock;
unsigned long type;
struct platform_device *battery; /* battery control (not fuel gauge) */
struct regmap *regmap;
- struct regmap *regmap_rtc;
- struct regmap *regmap_haptic;
- struct regmap *regmap_muic;
struct regmap_irq_chip_data *irq_data;
- struct regmap_irq_chip_data *irq_data_muic;
int irq;
int ono;
struct mutex irqlock;
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 1/3] mfd: max8997: use regmap to access registers
From: Krzysztof Kozlowski @ 2014-03-11 14:32 UTC (permalink / raw)
To: Robert Baldyga
Cc: sameo, lee.jones, myungjoo.ham, cw00.choi, dmitry.torokhov,
cooloney, rpurdie, dbaryshkov, dwmw2, lgirdwood, broonie, a.zummo,
paul.gortmaker, linux-kernel, linux-input, linux-leds, rtc-linux,
m.szyprowski
In-Reply-To: <1394546304-15191-2-git-send-email-r.baldyga@samsung.com>
On Tue, 2014-03-11 at 14:58 +0100, Robert Baldyga wrote:
> This patch modifies max8997 driver and each associated function driver,
> to use regmap instead of operating directly on i2c bus. It will allow to
> simplify IRQ handling using regmap-irq.
>
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
> drivers/extcon/extcon-max8997.c | 31 ++++----
> drivers/input/misc/max8997_haptic.c | 34 +++++----
> drivers/leds/leds-max8997.c | 13 ++--
> drivers/mfd/max8997-irq.c | 64 ++++++----------
> drivers/mfd/max8997.c | 143 ++++++++++++++++-------------------
> drivers/power/max8997_charger.c | 33 ++++----
> drivers/regulator/max8997.c | 87 ++++++++++-----------
> drivers/rtc/rtc-max8997.c | 56 ++++++++------
> include/linux/mfd/max8997-private.h | 17 ++---
> 9 files changed, 229 insertions(+), 249 deletions(-)
I think you should also add "select REGMAP_I2C" to the main driver
config secion (drivers/mfd/Kconfig).
(...)
> diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
> index 43fa614..656d03b 100644
> --- a/drivers/mfd/max8997-irq.c
> +++ b/drivers/mfd/max8997-irq.c
> @@ -26,6 +26,7 @@
> #include <linux/interrupt.h>
> #include <linux/mfd/max8997.h>
> #include <linux/mfd/max8997-private.h>
> +#include <linux/regmap.h>
>
> static const u8 max8997_mask_reg[] = {
> [PMIC_INT1] = MAX8997_REG_INT1MSK,
> @@ -41,25 +42,6 @@ static const u8 max8997_mask_reg[] = {
> [FLASH_STATUS] = MAX8997_REG_INVALID,
> };
>
> -static struct i2c_client *get_i2c(struct max8997_dev *max8997,
> - enum max8997_irq_source src)
> -{
> - switch (src) {
> - case PMIC_INT1 ... PMIC_INT4:
> - return max8997->i2c;
> - case FUEL_GAUGE:
> - return NULL;
> - case MUIC_INT1 ... MUIC_INT3:
> - return max8997->muic;
> - case GPIO_LOW ... GPIO_HI:
> - return max8997->i2c;
> - case FLASH_STATUS:
> - return max8997->i2c;
> - default:
> - return ERR_PTR(-EINVAL);
> - }
> -}
> -
> struct max8997_irq_data {
> int mask;
> enum max8997_irq_source group;
> @@ -124,15 +106,20 @@ static void max8997_irq_sync_unlock(struct irq_data *data)
> int i;
>
> for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
> + struct regmap *map;
> u8 mask_reg = max8997_mask_reg[i];
> - struct i2c_client *i2c = get_i2c(max8997, i);
> +
> + if (i >= MUIC_INT1 && i <= MUIC_INT3)
> + map = max8997->regmap_muic;
> + else
> + map = max8997->regmap;
>
> if (mask_reg == MAX8997_REG_INVALID ||
> - IS_ERR_OR_NULL(i2c))
> + IS_ERR_OR_NULL(map))
> continue;
> max8997->irq_masks_cache[i] = max8997->irq_masks_cur[i];
>
> - max8997_write_reg(i2c, max8997_mask_reg[i],
> + regmap_write(map, max8997_mask_reg[i],
> max8997->irq_masks_cur[i]);
> }
>
> @@ -180,12 +167,12 @@ static struct irq_chip max8997_irq_chip = {
> static irqreturn_t max8997_irq_thread(int irq, void *data)
> {
> struct max8997_dev *max8997 = data;
> - u8 irq_reg[MAX8997_IRQ_GROUP_NR] = {};
> - u8 irq_src;
> + unsigned int irq_reg[MAX8997_IRQ_GROUP_NR] = {};
> + unsigned int irq_src;
> int ret;
> int i, cur_irq;
>
> - ret = max8997_read_reg(max8997->i2c, MAX8997_REG_INTSRC, &irq_src);
> + ret = regmap_read(max8997->regmap, MAX8997_REG_INTSRC, &irq_src);
> if (ret < 0) {
> dev_err(max8997->dev, "Failed to read interrupt source: %d\n",
> ret);
> @@ -194,8 +181,9 @@ static irqreturn_t max8997_irq_thread(int irq, void *data)
>
> if (irq_src & MAX8997_IRQSRC_PMIC) {
> /* PMIC INT1 ~ INT4 */
> - max8997_bulk_read(max8997->i2c, MAX8997_REG_INT1, 4,
> - &irq_reg[PMIC_INT1]);
> + for (i = 0; i < 4; ++i)
> + regmap_read(max8997->regmap,
> + MAX8997_REG_INT1+i, &irq_reg[PMIC_INT1+i]);
Can't you use here one bulk read instead of 4xregmap_read()?
> }
> if (irq_src & MAX8997_IRQSRC_FUELGAUGE) {
> /*
> @@ -215,8 +203,9 @@ static irqreturn_t max8997_irq_thread(int irq, void *data)
> }
> if (irq_src & MAX8997_IRQSRC_MUIC) {
> /* MUIC INT1 ~ INT3 */
> - max8997_bulk_read(max8997->muic, MAX8997_MUIC_REG_INT1, 3,
> - &irq_reg[MUIC_INT1]);
> + for (i = 0; i < 3; ++i)
> + regmap_read(max8997->regmap_muic,
> + MAX8997_MUIC_REG_INT1+i, &irq_reg[MUIC_INT1+i]);
Same as above - bulk.
> }
> if (irq_src & MAX8997_IRQSRC_GPIO) {
> /* GPIO Interrupt */
> @@ -225,8 +214,8 @@ static irqreturn_t max8997_irq_thread(int irq, void *data)
> irq_reg[GPIO_LOW] = 0;
> irq_reg[GPIO_HI] = 0;
>
> - max8997_bulk_read(max8997->i2c, MAX8997_REG_GPIOCNTL1,
> - MAX8997_NUM_GPIO, gpio_info);
> + regmap_bulk_read(max8997->regmap, MAX8997_REG_GPIOCNTL1,
> + gpio_info, MAX8997_NUM_GPIO);
> for (i = 0; i < MAX8997_NUM_GPIO; i++) {
> bool interrupt = false;
>
> @@ -260,7 +249,7 @@ static irqreturn_t max8997_irq_thread(int irq, void *data)
> }
> if (irq_src & MAX8997_IRQSRC_FLASH) {
> /* Flash Status Interrupt */
> - ret = max8997_read_reg(max8997->i2c, MAX8997_REG_FLASHSTATUS,
> + ret = regmap_read(max8997->regmap, MAX8997_REG_FLASHSTATUS,
> &irq_reg[FLASH_STATUS]);
> }
>
> @@ -312,7 +301,7 @@ int max8997_irq_init(struct max8997_dev *max8997)
> struct irq_domain *domain;
> int i;
> int ret;
> - u8 val;
> + unsigned int val;
>
> if (!max8997->irq) {
> dev_warn(max8997->dev, "No interrupt specified.\n");
> @@ -323,22 +312,19 @@ int max8997_irq_init(struct max8997_dev *max8997)
>
> /* Mask individual interrupt sources */
> for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
> - struct i2c_client *i2c;
> -
> max8997->irq_masks_cur[i] = 0xff;
> max8997->irq_masks_cache[i] = 0xff;
> - i2c = get_i2c(max8997, i);
>
> - if (IS_ERR_OR_NULL(i2c))
> + if (IS_ERR_OR_NULL(max8997->regmap))
> continue;
> if (max8997_mask_reg[i] == MAX8997_REG_INVALID)
> continue;
>
> - max8997_write_reg(i2c, max8997_mask_reg[i], 0xff);
> + regmap_write(max8997->regmap, max8997_mask_reg[i], 0xff);
> }
>
> for (i = 0; i < MAX8997_NUM_GPIO; i++) {
> - max8997->gpio_status[i] = (max8997_read_reg(max8997->i2c,
> + max8997->gpio_status[i] = (regmap_read(max8997->regmap,
> MAX8997_REG_GPIOCNTL1 + i,
> &val)
> & MAX8997_GPIO_DATA_MASK) ?
> diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
> index 5adede0..ca6f310 100644
> --- a/drivers/mfd/max8997.c
> +++ b/drivers/mfd/max8997.c
> @@ -33,6 +33,7 @@
> #include <linux/mfd/core.h>
> #include <linux/mfd/max8997.h>
> #include <linux/mfd/max8997-private.h>
> +#include <linux/regmap.h>
>
> #define I2C_ADDR_PMIC (0xCC >> 1)
> #define I2C_ADDR_MUIC (0x4A >> 1)
> @@ -57,81 +58,29 @@ static struct of_device_id max8997_pmic_dt_match[] = {
> };
> #endif
>
> -int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest)
> -{
> - struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
> - int ret;
> -
> - mutex_lock(&max8997->iolock);
> - ret = i2c_smbus_read_byte_data(i2c, reg);
> - mutex_unlock(&max8997->iolock);
> - if (ret < 0)
> - return ret;
> -
> - ret &= 0xff;
> - *dest = ret;
> - return 0;
> -}
> -EXPORT_SYMBOL_GPL(max8997_read_reg);
> -
> -int max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count, u8 *buf)
> -{
> - struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
> - int ret;
> -
> - mutex_lock(&max8997->iolock);
> - ret = i2c_smbus_read_i2c_block_data(i2c, reg, count, buf);
> - mutex_unlock(&max8997->iolock);
> - if (ret < 0)
> - return ret;
> -
> - return 0;
> -}
> -EXPORT_SYMBOL_GPL(max8997_bulk_read);
> -
> -int max8997_write_reg(struct i2c_client *i2c, u8 reg, u8 value)
> -{
> - struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
> - int ret;
> -
> - mutex_lock(&max8997->iolock);
> - ret = i2c_smbus_write_byte_data(i2c, reg, value);
> - mutex_unlock(&max8997->iolock);
> - return ret;
> -}
> -EXPORT_SYMBOL_GPL(max8997_write_reg);
> -
> -int max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count, u8 *buf)
> -{
> - struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
> - int ret;
> +static const struct regmap_config max8997_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .max_register = MAX8997_REG_PMIC_END,
> +};
>
> - mutex_lock(&max8997->iolock);
> - ret = i2c_smbus_write_i2c_block_data(i2c, reg, count, buf);
> - mutex_unlock(&max8997->iolock);
> - if (ret < 0)
> - return ret;
> +static const struct regmap_config max8997_regmap_rtc_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .max_register = MAX8997_RTC_REG_END,
> +};
>
> - return 0;
> -}
> -EXPORT_SYMBOL_GPL(max8997_bulk_write);
> +static const struct regmap_config max8997_regmap_haptic_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .max_register = MAX8997_HAPTIC_REG_END,
> +};
>
> -int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask)
> -{
> - struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
> - int ret;
> -
> - mutex_lock(&max8997->iolock);
> - ret = i2c_smbus_read_byte_data(i2c, reg);
> - if (ret >= 0) {
> - u8 old_val = ret & 0xff;
> - u8 new_val = (val & mask) | (old_val & (~mask));
> - ret = i2c_smbus_write_byte_data(i2c, reg, new_val);
> - }
> - mutex_unlock(&max8997->iolock);
> - return ret;
> -}
> -EXPORT_SYMBOL_GPL(max8997_update_reg);
> +static const struct regmap_config max8997_regmap_muic_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .max_register = MAX8997_MUIC_REG_END,
> +};
>
> /*
> * Only the common platform data elements for max8997 are parsed here from the
> @@ -209,11 +158,48 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
>
> max8997->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC);
> i2c_set_clientdata(max8997->rtc, max8997);
> +
> max8997->haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC);
> i2c_set_clientdata(max8997->haptic, max8997);
> +
> max8997->muic = i2c_new_dummy(i2c->adapter, I2C_ADDR_MUIC);
> i2c_set_clientdata(max8997->muic, max8997);
>
> + max8997->regmap = devm_regmap_init_i2c(i2c, &max8997_regmap_config);
> + if (IS_ERR(max8997->regmap)) {
> + ret = PTR_ERR(max8997->regmap);
> + dev_err(max8997->dev,
> + "failed to allocate register map: %d\n", ret);
> + return ret;
> + }
> +
> + max8997->regmap_rtc = devm_regmap_init_i2c(max8997->rtc,
> + &max8997_regmap_rtc_config);
> + if (IS_ERR(max8997->regmap_rtc)) {
> + ret = PTR_ERR(max8997->regmap_rtc);
> + dev_err(max8997->dev,
> + "failed to allocate register map: %d\n", ret);
> + goto err_regmap;
> + }
> +
> + max8997->regmap_haptic = devm_regmap_init_i2c(max8997->haptic,
> + &max8997_regmap_haptic_config);
> + if (IS_ERR(max8997->regmap_haptic)) {
> + ret = PTR_ERR(max8997->regmap_haptic);
> + dev_err(max8997->dev,
> + "failed to allocate register map: %d\n", ret);
> + goto err_regmap;
> + }
> +
> + max8997->regmap_muic = devm_regmap_init_i2c(max8997->muic,
> + &max8997_regmap_muic_config);
> + if (IS_ERR(max8997->regmap_muic)) {
> + ret = PTR_ERR(max8997->regmap_muic);
> + dev_err(max8997->dev,
> + "failed to allocate register map: %d\n", ret);
> + goto err_regmap;
> + }
> +
> pm_runtime_set_active(max8997->dev);
>
> max8997_irq_init(max8997);
> @@ -238,6 +224,7 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
>
> err_mfd:
> mfd_remove_devices(max8997->dev);
> +err_regmap:
> i2c_unregister_device(max8997->muic);
> i2c_unregister_device(max8997->haptic);
> i2c_unregister_device(max8997->rtc);
> @@ -423,15 +410,15 @@ static int max8997_freeze(struct device *dev)
> int i;
>
> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_pmic); i++)
> - max8997_read_reg(i2c, max8997_dumpaddr_pmic[i],
> + regmap_read(max8997->regmap, max8997_dumpaddr_pmic[i],
> &max8997->reg_dump[i]);
>
> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_muic); i++)
> - max8997_read_reg(i2c, max8997_dumpaddr_muic[i],
> + regmap_read(max8997->regmap_muic, max8997_dumpaddr_muic[i],
> &max8997->reg_dump[i + MAX8997_REG_PMIC_END]);
>
> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_haptic); i++)
> - max8997_read_reg(i2c, max8997_dumpaddr_haptic[i],
> + regmap_read(max8997->regmap_haptic, max8997_dumpaddr_haptic[i],
> &max8997->reg_dump[i + MAX8997_REG_PMIC_END +
> MAX8997_MUIC_REG_END]);
Code looks good. Idea for another patch: could bulk read be used here?
At least some of registers have continuous addresses so maybe its worth
to read them at once?
>
> @@ -445,15 +432,15 @@ static int max8997_restore(struct device *dev)
> int i;
>
> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_pmic); i++)
> - max8997_write_reg(i2c, max8997_dumpaddr_pmic[i],
> + regmap_write(max8997->regmap, max8997_dumpaddr_pmic[i],
> max8997->reg_dump[i]);
>
> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_muic); i++)
> - max8997_write_reg(i2c, max8997_dumpaddr_muic[i],
> + regmap_write(max8997->regmap_muic, max8997_dumpaddr_muic[i],
> max8997->reg_dump[i + MAX8997_REG_PMIC_END]);
>
> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_haptic); i++)
> - max8997_write_reg(i2c, max8997_dumpaddr_haptic[i],
> + regmap_write(max8997->regmap_haptic, max8997_dumpaddr_haptic[i],
> max8997->reg_dump[i + MAX8997_REG_PMIC_END +
> MAX8997_MUIC_REG_END]);
As above - bulk write (if you still would like to improve things in this
driver)?
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH 2/3] mfd: max8997: handle IRQs using regmap
From: Krzysztof Kozlowski @ 2014-03-11 14:43 UTC (permalink / raw)
To: Robert Baldyga
Cc: sameo, lee.jones, myungjoo.ham, cw00.choi, dmitry.torokhov,
cooloney, rpurdie, dbaryshkov, dwmw2, lgirdwood, broonie, a.zummo,
paul.gortmaker, linux-kernel, linux-input, linux-leds, rtc-linux,
m.szyprowski
In-Reply-To: <1394546304-15191-3-git-send-email-r.baldyga@samsung.com>
On Tue, 2014-03-11 at 14:58 +0100, Robert Baldyga wrote:
> This patch modifies mfd driver to use regmap for handling interrupts.
> It allows to simplify irq handling process. This modifications needed
> to make small changes in function drivers, which use interrupts.
>
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
> drivers/extcon/extcon-max8997.c | 3 +-
> drivers/mfd/Makefile | 2 +-
> drivers/mfd/max8997-irq.c | 373 -----------------------------------
> drivers/mfd/max8997.c | 91 ++++++++-
> drivers/rtc/rtc-max8997.c | 2 +-
> include/linux/mfd/max8997-private.h | 63 +++++-
> 6 files changed, 147 insertions(+), 387 deletions(-)
> delete mode 100644 drivers/mfd/max8997-irq.c
Add "select REGMAP_IRQ" in Kconfig.
(...)
> diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
> index ca6f310..9b6edfa 100644
> --- a/drivers/mfd/max8997.c
> +++ b/drivers/mfd/max8997.c
> @@ -64,6 +64,49 @@ static const struct regmap_config max8997_regmap_config = {
> .max_register = MAX8997_REG_PMIC_END,
> };
>
> +static const struct regmap_irq max8997_irqs[] = {
> + /* PMIC_INT1 interrupts */
> + { .reg_offset = 0, .mask = PMIC_INT1_PWRONR_MASK, },
> + { .reg_offset = 0, .mask = PMIC_INT1_PWRONF_MASK, },
> + { .reg_offset = 0, .mask = PMIC_INT1_PWRON1SEC_MASK, },
> + { .reg_offset = 0, .mask = PMIC_INT1_JIGONR_MASK, },
> + { .reg_offset = 0, .mask = PMIC_INT1_JIGONF_MASK, },
> + { .reg_offset = 0, .mask = PMIC_INT1_LOWBAT2_MASK, },
> + { .reg_offset = 0, .mask = PMIC_INT1_LOWBAT1_MASK, },
> + /* PMIC_INT2 interrupts */
> + { .reg_offset = 1, .mask = PMIC_INT2_JIGR_MASK, },
> + { .reg_offset = 1, .mask = PMIC_INT2_JIGF_MASK, },
> + { .reg_offset = 1, .mask = PMIC_INT2_MR_MASK, },
> + { .reg_offset = 1, .mask = PMIC_INT2_DVS1OK_MASK, },
> + { .reg_offset = 1, .mask = PMIC_INT2_DVS2OK_MASK, },
> + { .reg_offset = 1, .mask = PMIC_INT2_DVS3OK_MASK, },
> + { .reg_offset = 1, .mask = PMIC_INT2_DVS4OK_MASK, },
> + /* PMIC_INT3 interrupts */
> + { .reg_offset = 2, .mask = PMIC_INT3_CHGINS_MASK, },
> + { .reg_offset = 2, .mask = PMIC_INT3_CHGRM_MASK, },
> + { .reg_offset = 2, .mask = PMIC_INT3_DCINOVP_MASK, },
> + { .reg_offset = 2, .mask = PMIC_INT3_TOPOFFR_MASK, },
> + { .reg_offset = 2, .mask = PMIC_INT3_CHGRSTF_MASK, },
> + { .reg_offset = 2, .mask = PMIC_INT3_MBCHGTMEXPD_MASK, },
> + /* PMIC_INT4 interrupts */
> + { .reg_offset = 3, .mask = PMIC_INT4_RTC60S_MASK, },
> + { .reg_offset = 3, .mask = PMIC_INT4_RTCA1_MASK, },
> + { .reg_offset = 3, .mask = PMIC_INT4_RTCA2_MASK, },
> + { .reg_offset = 3, .mask = PMIC_INT4_SMPL_INT_MASK, },
> + { .reg_offset = 3, .mask = PMIC_INT4_RTC1S_MASK, },
> + { .reg_offset = 3, .mask = PMIC_INT4_WTSR_MASK, },
> +};
> +
> +static const struct regmap_irq_chip max8997_irq_chip = {
> + .name = "max8997",
> + .status_base = MAX8997_REG_INT1,
> + .mask_base = MAX8997_REG_INT1MSK,
> + .mask_invert = false,
> + .num_regs = 4,
> + .irqs = max8997_irqs,
> + .num_irqs = ARRAY_SIZE(max8997_irqs),
> +};
> +
> static const struct regmap_config max8997_regmap_rtc_config = {
> .reg_bits = 8,
> .val_bits = 8,
> @@ -82,6 +125,31 @@ static const struct regmap_config max8997_regmap_muic_config = {
> .max_register = MAX8997_MUIC_REG_END,
> };
>
> +static const struct regmap_irq max8997_irqs_muic[] = {
> + /* MUIC_INT1 interrupts */
> + { .reg_offset = 0, .mask = MUIC_INT1_ADC_MASK, },
> + { .reg_offset = 0, .mask = MUIC_INT1_ADCLow_MASK, },
> + { .reg_offset = 0, .mask = MUIC_INT1_ADCError_MASK, },
> + /* MUIC_INT2 interrupts */
> + { .reg_offset = 1, .mask = MUIC_INT2_ChgTyp_MASK, },
> + { .reg_offset = 1, .mask = MUIC_INT2_ChgDetRun_MASK, },
> + { .reg_offset = 1, .mask = MUIC_INT2_DCDTmr_MASK, },
> + { .reg_offset = 1, .mask = MUIC_INT2_DBChg_MASK, },
> + { .reg_offset = 1, .mask = MUIC_INT2_VBVolt_MASK, },
> + /* MUIC_INT3 interrupts */
> + { .reg_offset = 2, .mask = MUIC_INT3_OVP_MASK, },
> +};
> +
> +static const struct regmap_irq_chip max8997_irq_chip_muic = {
> + .name = "max8997-muic",
> + .status_base = MAX8997_MUIC_REG_INT1,
> + .mask_base = MAX8997_MUIC_REG_INTMASK1,
> + .mask_invert = true,
> + .num_regs = 3,
> + .irqs = max8997_irqs_muic,
> + .num_irqs = ARRAY_SIZE(max8997_irqs_muic),
> +};
> +
> /*
> * Only the common platform data elements for max8997 are parsed here from the
> * device tree. Other sub-modules of max8997 such as pmic, rtc and others have
> @@ -173,6 +241,15 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
> return ret;
> }
>
> + ret = regmap_add_irq_chip(max8997->regmap, max8997->irq,
> + IRQF_ONESHOT | IRQF_SHARED |
> + IRQF_TRIGGER_FALLING, 0,
> + &max8997_irq_chip, &max8997->irq_data);
> + if (ret) {
> + dev_err(max8997->dev, "failed to add irq chip: %d\n", ret);
> + return ret;
> + }
> +
Add regmap_del_irq_chip() on driver remove and where needed on probe
error paths.
> max8997->regmap_rtc = devm_regmap_init_i2c(max8997->rtc,
> &max8997_regmap_rtc_config);
> if (IS_ERR(max8997->regmap_rtc)) {
> @@ -200,9 +277,17 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
> goto err_regmap;
> }
>
> - pm_runtime_set_active(max8997->dev);
> + ret = regmap_add_irq_chip(max8997->regmap_muic, max8997->irq,
> + IRQF_ONESHOT | IRQF_SHARED |
> + IRQF_TRIGGER_FALLING, 0,
> + &max8997_irq_chip_muic,
> + &max8997->irq_data_muic);
> + if (ret) {
> + dev_err(max8997->dev, "failed to add irq chip: %d\n", ret);
> + return ret;
> + }
>
> - max8997_irq_init(max8997);
> + pm_runtime_set_active(max8997->dev);
>
> ret = mfd_add_devices(max8997->dev, -1, max8997_devs,
> ARRAY_SIZE(max8997_devs),
> @@ -464,7 +549,7 @@ static int max8997_resume(struct device *dev)
>
> if (device_may_wakeup(dev))
> irq_set_irq_wake(max8997->irq, 0);
> - return max8997_irq_resume(max8997);
> + return 0;
> }
Actually you're changing a little driver logic here. I think the
max8997_irq_resume() was here on purpose - to process any interrupts and
clear interrupt registers (e.g. MUIC from) after resuming. Is it working
properly during suspend/resume? Is it working when the MUIC interrupt is
the wake up source?
> static const struct dev_pm_ops max8997_pm = {
> diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
> index b866f7d5..22769ea 100644
> --- a/drivers/rtc/rtc-max8997.c
> +++ b/drivers/rtc/rtc-max8997.c
> @@ -494,7 +494,7 @@ static int max8997_rtc_probe(struct platform_device *pdev)
> return ret;
> }
>
> - virq = irq_create_mapping(max8997->irq_domain, MAX8997_PMICIRQ_RTCA1);
> + virq = regmap_irq_get_virq(max8997->irq_data, MAX8997_PMICIRQ_RTCA1);
> if (!virq) {
> dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n");
> ret = -ENXIO;
> diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
> index ea80ef8..af2f0aa 100644
> --- a/include/linux/mfd/max8997-private.h
> +++ b/include/linux/mfd/max8997-private.h
> @@ -333,6 +333,48 @@ enum max8997_irq_source {
> MAX8997_IRQ_GROUP_NR,
> };
>
> +#define PMIC_INT1_PWRONR_MASK (0x1 << 0)
> +#define PMIC_INT1_PWRONF_MASK (0x1 << 1)
> +#define PMIC_INT1_PWRON1SEC_MASK (0x1 << 3)
> +#define PMIC_INT1_JIGONR_MASK (0x1 << 4)
> +#define PMIC_INT1_JIGONF_MASK (0x1 << 5)
> +#define PMIC_INT1_LOWBAT2_MASK (0x1 << 6)
> +#define PMIC_INT1_LOWBAT1_MASK (0x1 << 7)
> +
> +#define PMIC_INT2_JIGR_MASK (0x1 << 0)
> +#define PMIC_INT2_JIGF_MASK (0x1 << 1)
> +#define PMIC_INT2_MR_MASK (0x1 << 2)
> +#define PMIC_INT2_DVS1OK_MASK (0x1 << 3)
> +#define PMIC_INT2_DVS2OK_MASK (0x1 << 4)
> +#define PMIC_INT2_DVS3OK_MASK (0x1 << 5)
> +#define PMIC_INT2_DVS4OK_MASK (0x1 << 6)
> +
> +#define PMIC_INT3_CHGINS_MASK (0x1 << 0)
> +#define PMIC_INT3_CHGRM_MASK (0x1 << 1)
> +#define PMIC_INT3_DCINOVP_MASK (0x1 << 2)
> +#define PMIC_INT3_TOPOFFR_MASK (0x1 << 3)
> +#define PMIC_INT3_CHGRSTF_MASK (0x1 << 5)
> +#define PMIC_INT3_MBCHGTMEXPD_MASK (0x1 << 7)
> +
> +#define PMIC_INT4_RTC60S_MASK (0x1 << 0)
> +#define PMIC_INT4_RTCA1_MASK (0x1 << 1)
> +#define PMIC_INT4_RTCA2_MASK (0x1 << 2)
> +#define PMIC_INT4_SMPL_INT_MASK (0x1 << 3)
> +#define PMIC_INT4_RTC1S_MASK (0x1 << 4)
> +#define PMIC_INT4_WTSR_MASK (0x1 << 5)
> +
> +#define MUIC_INT1_ADC_MASK (0x1 << 0)
> +#define MUIC_INT1_ADCLow_MASK (0x1 << 1)
> +#define MUIC_INT1_ADCError_MASK (0x1 << 2)
> +
> +#define MUIC_INT2_ChgTyp_MASK (0x1 << 0)
> +#define MUIC_INT2_ChgDetRun_MASK (0x1 << 1)
> +#define MUIC_INT2_DCDTmr_MASK (0x1 << 2)
> +#define MUIC_INT2_DBChg_MASK (0x1 << 3)
> +#define MUIC_INT2_VBVolt_MASK (0x1 << 4)
You changed here naming convention to CamelCase. Any reasons?
> +
> +#define MUIC_INT3_OVP_MASK (0x1 << 2)
> +
> enum max8997_irq {
> MAX8997_PMICIRQ_PWRONR,
> MAX8997_PMICIRQ_PWRONF,
> @@ -364,19 +406,23 @@ enum max8997_irq {
> MAX8997_PMICIRQ_RTC1S,
> MAX8997_PMICIRQ_WTSR,
>
> - MAX8997_MUICIRQ_ADCError,
> - MAX8997_MUICIRQ_ADCLow,
> + MAX8997_PMICIRQ_NR,
> +};
> +
> +enum max8997_irq_muic {
> MAX8997_MUICIRQ_ADC,
> + MAX8997_MUICIRQ_ADCLow,
> + MAX8997_MUICIRQ_ADCError,
>
> - MAX8997_MUICIRQ_VBVolt,
> - MAX8997_MUICIRQ_DBChg,
> - MAX8997_MUICIRQ_DCDTmr,
> - MAX8997_MUICIRQ_ChgDetRun,
> MAX8997_MUICIRQ_ChgTyp,
> + MAX8997_MUICIRQ_ChgDetRun,
> + MAX8997_MUICIRQ_DCDTmr,
> + MAX8997_MUICIRQ_DBChg,
> + MAX8997_MUICIRQ_VBVolt,
>
> MAX8997_MUICIRQ_OVP,
>
> - MAX8997_IRQ_NR,
> + MAX8997_MUCIRQ_NR,
> };
Camel shows up once again.
>
> #define MAX8997_NUM_GPIO 12
> @@ -397,9 +443,10 @@ struct max8997_dev {
> struct regmap *regmap_haptic;
> struct regmap *regmap_muic;
>
> + struct regmap_irq_chip_data *irq_data;
> + struct regmap_irq_chip_data *irq_data_muic;
> int irq;
> int ono;
> - struct irq_domain *irq_domain;
> struct mutex irqlock;
> int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
> int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
^ permalink raw reply
* Re: [PATCH 1/3] mfd: max8997: use regmap to access registers
From: Robert Baldyga @ 2014-03-11 14:59 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: sameo, lee.jones, myungjoo.ham, cw00.choi, dmitry.torokhov,
cooloney, rpurdie, dbaryshkov, dwmw2, lgirdwood, broonie, a.zummo,
paul.gortmaker, linux-kernel, linux-input, linux-leds, rtc-linux,
m.szyprowski
In-Reply-To: <1394548336.24263.7.camel@AMDC1943>
On 03/11/2014 03:32 PM, Krzysztof Kozlowski wrote:
> On Tue, 2014-03-11 at 14:58 +0100, Robert Baldyga wrote:
>> This patch modifies max8997 driver and each associated function
>> driver, to use regmap instead of operating directly on i2c bus. It
>> will allow to simplify IRQ handling using regmap-irq.
>>
>> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> ---
>> drivers/extcon/extcon-max8997.c | 31 ++++----
>> drivers/input/misc/max8997_haptic.c | 34 +++++----
>> drivers/leds/leds-max8997.c | 13 ++--
>> drivers/mfd/max8997-irq.c | 64 ++++++----------
>> drivers/mfd/max8997.c | 143
>> ++++++++++++++++-------------------
>> drivers/power/max8997_charger.c | 33 ++++----
>> drivers/regulator/max8997.c | 87 ++++++++++-----------
>> drivers/rtc/rtc-max8997.c | 56 ++++++++------
>> include/linux/mfd/max8997-private.h | 17 ++--- 9 files changed,
>> 229 insertions(+), 249 deletions(-)
>
> I think you should also add "select REGMAP_I2C" to the main driver
> config secion (drivers/mfd/Kconfig).
Will be fixed.
>
> (...)
>
>> diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
>> index 43fa614..656d03b 100644 --- a/drivers/mfd/max8997-irq.c +++
>> b/drivers/mfd/max8997-irq.c @@ -26,6 +26,7 @@ #include
>> <linux/interrupt.h> #include <linux/mfd/max8997.h> #include
>> <linux/mfd/max8997-private.h> +#include <linux/regmap.h>
>>
>> static const u8 max8997_mask_reg[] = { [PMIC_INT1] =
>> MAX8997_REG_INT1MSK, @@ -41,25 +42,6 @@ static const u8
>> max8997_mask_reg[] = { [FLASH_STATUS] = MAX8997_REG_INVALID, };
>>
>> -static struct i2c_client *get_i2c(struct max8997_dev *max8997, -
>> enum max8997_irq_source src) -{ - switch (src) { - case PMIC_INT1
>> ... PMIC_INT4: - return max8997->i2c; - case FUEL_GAUGE: - return
>> NULL; - case MUIC_INT1 ... MUIC_INT3: - return max8997->muic; -
>> case GPIO_LOW ... GPIO_HI: - return max8997->i2c; - case
>> FLASH_STATUS: - return max8997->i2c; - default: - return
>> ERR_PTR(-EINVAL); - } -} - struct max8997_irq_data { int mask;
>> enum max8997_irq_source group; @@ -124,15 +106,20 @@ static void
>> max8997_irq_sync_unlock(struct irq_data *data) int i;
>>
>> for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) { + struct regmap *map;
>> u8 mask_reg = max8997_mask_reg[i]; - struct i2c_client *i2c =
>> get_i2c(max8997, i); + + if (i >= MUIC_INT1 && i <= MUIC_INT3) +
>> map = max8997->regmap_muic; + else + map = max8997->regmap;
>>
>> if (mask_reg == MAX8997_REG_INVALID || - IS_ERR_OR_NULL(i2c)) +
>> IS_ERR_OR_NULL(map)) continue; max8997->irq_masks_cache[i] =
>> max8997->irq_masks_cur[i];
>>
>> - max8997_write_reg(i2c, max8997_mask_reg[i], + regmap_write(map,
>> max8997_mask_reg[i], max8997->irq_masks_cur[i]); }
>>
>> @@ -180,12 +167,12 @@ static struct irq_chip max8997_irq_chip = {
>> static irqreturn_t max8997_irq_thread(int irq, void *data) {
>> struct max8997_dev *max8997 = data; - u8
>> irq_reg[MAX8997_IRQ_GROUP_NR] = {}; - u8 irq_src; + unsigned int
>> irq_reg[MAX8997_IRQ_GROUP_NR] = {}; + unsigned int irq_src; int
>> ret; int i, cur_irq;
>>
>> - ret = max8997_read_reg(max8997->i2c, MAX8997_REG_INTSRC,
>> &irq_src); + ret = regmap_read(max8997->regmap,
>> MAX8997_REG_INTSRC, &irq_src); if (ret < 0) { dev_err(max8997->dev,
>> "Failed to read interrupt source: %d\n", ret); @@ -194,8 +181,9 @@
>> static irqreturn_t max8997_irq_thread(int irq, void *data)
>>
>> if (irq_src & MAX8997_IRQSRC_PMIC) { /* PMIC INT1 ~ INT4 */ -
>> max8997_bulk_read(max8997->i2c, MAX8997_REG_INT1, 4, -
>> &irq_reg[PMIC_INT1]); + for (i = 0; i < 4; ++i) +
>> regmap_read(max8997->regmap, + MAX8997_REG_INT1+i,
>> &irq_reg[PMIC_INT1+i]);
>
> Can't you use here one bulk read instead of 4xregmap_read()?
Mixing regmap_read and regmap_bulk_read is not good idea, because the
first function returns register value as unsigned int, but the second
returns reg value to each single byte. So it would need to do some
additional operations, and makes things more complicated.
>
>
>> } if (irq_src & MAX8997_IRQSRC_FUELGAUGE) { /* @@ -215,8 +203,9 @@
>> static irqreturn_t max8997_irq_thread(int irq, void *data) } if
>> (irq_src & MAX8997_IRQSRC_MUIC) { /* MUIC INT1 ~ INT3 */ -
>> max8997_bulk_read(max8997->muic, MAX8997_MUIC_REG_INT1, 3, -
>> &irq_reg[MUIC_INT1]); + for (i = 0; i < 3; ++i) +
>> regmap_read(max8997->regmap_muic, + MAX8997_MUIC_REG_INT1+i,
>> &irq_reg[MUIC_INT1+i]);
>
> Same as above - bulk.
>
>> } if (irq_src & MAX8997_IRQSRC_GPIO) { /* GPIO Interrupt */ @@
>> -225,8 +214,8 @@ static irqreturn_t max8997_irq_thread(int irq,
>> void *data) irq_reg[GPIO_LOW] = 0; irq_reg[GPIO_HI] = 0;
>>
>> - max8997_bulk_read(max8997->i2c, MAX8997_REG_GPIOCNTL1, -
>> MAX8997_NUM_GPIO, gpio_info); + regmap_bulk_read(max8997->regmap,
>> MAX8997_REG_GPIOCNTL1, + gpio_info, MAX8997_NUM_GPIO); for (i =
>> 0; i < MAX8997_NUM_GPIO; i++) { bool interrupt = false;
>>
>> @@ -260,7 +249,7 @@ static irqreturn_t max8997_irq_thread(int irq,
>> void *data) } if (irq_src & MAX8997_IRQSRC_FLASH) { /* Flash Status
>> Interrupt */ - ret = max8997_read_reg(max8997->i2c,
>> MAX8997_REG_FLASHSTATUS, + ret = regmap_read(max8997->regmap,
>> MAX8997_REG_FLASHSTATUS, &irq_reg[FLASH_STATUS]); }
>>
>> @@ -312,7 +301,7 @@ int max8997_irq_init(struct max8997_dev
>> *max8997) struct irq_domain *domain; int i; int ret; - u8 val; +
>> unsigned int val;
>>
>> if (!max8997->irq) { dev_warn(max8997->dev, "No interrupt
>> specified.\n"); @@ -323,22 +312,19 @@ int max8997_irq_init(struct
>> max8997_dev *max8997)
>>
>> /* Mask individual interrupt sources */ for (i = 0; i <
>> MAX8997_IRQ_GROUP_NR; i++) { - struct i2c_client *i2c; -
>> max8997->irq_masks_cur[i] = 0xff; max8997->irq_masks_cache[i] =
>> 0xff; - i2c = get_i2c(max8997, i);
>>
>> - if (IS_ERR_OR_NULL(i2c)) + if (IS_ERR_OR_NULL(max8997->regmap))
>> continue; if (max8997_mask_reg[i] == MAX8997_REG_INVALID)
>> continue;
>>
>> - max8997_write_reg(i2c, max8997_mask_reg[i], 0xff); +
>> regmap_write(max8997->regmap, max8997_mask_reg[i], 0xff); }
>>
>> for (i = 0; i < MAX8997_NUM_GPIO; i++) { - max8997->gpio_status[i]
>> = (max8997_read_reg(max8997->i2c, + max8997->gpio_status[i] =
>> (regmap_read(max8997->regmap, MAX8997_REG_GPIOCNTL1 + i, &val) &
>> MAX8997_GPIO_DATA_MASK) ? diff --git a/drivers/mfd/max8997.c
>> b/drivers/mfd/max8997.c index 5adede0..ca6f310 100644 ---
>> a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c @@ -33,6 +33,7
>> @@ #include <linux/mfd/core.h> #include <linux/mfd/max8997.h>
>> #include <linux/mfd/max8997-private.h> +#include <linux/regmap.h>
>>
>> #define I2C_ADDR_PMIC (0xCC >> 1) #define I2C_ADDR_MUIC (0x4A >> 1)
>> @@ -57,81 +58,29 @@ static struct of_device_id
>> max8997_pmic_dt_match[] = { }; #endif
>>
>> -int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) -{
>> - struct max8997_dev *max8997 = i2c_get_clientdata(i2c); - int
>> ret; - - mutex_lock(&max8997->iolock); - ret =
>> i2c_smbus_read_byte_data(i2c, reg); -
>> mutex_unlock(&max8997->iolock); - if (ret < 0) - return ret; - -
>> ret &= 0xff; - *dest = ret; - return 0; -}
>> -EXPORT_SYMBOL_GPL(max8997_read_reg); - -int
>> max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count, u8
>> *buf) -{ - struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
>> - int ret; - - mutex_lock(&max8997->iolock); - ret =
>> i2c_smbus_read_i2c_block_data(i2c, reg, count, buf); -
>> mutex_unlock(&max8997->iolock); - if (ret < 0) - return ret; - -
>> return 0; -} -EXPORT_SYMBOL_GPL(max8997_bulk_read); - -int
>> max8997_write_reg(struct i2c_client *i2c, u8 reg, u8 value) -{ -
>> struct max8997_dev *max8997 = i2c_get_clientdata(i2c); - int ret; -
>> - mutex_lock(&max8997->iolock); - ret =
>> i2c_smbus_write_byte_data(i2c, reg, value); -
>> mutex_unlock(&max8997->iolock); - return ret; -}
>> -EXPORT_SYMBOL_GPL(max8997_write_reg); - -int
>> max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count, u8
>> *buf) -{ - struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
>> - int ret; +static const struct regmap_config max8997_regmap_config
>> = { + .reg_bits = 8, + .val_bits = 8, + .max_register =
>> MAX8997_REG_PMIC_END, +};
>>
>> - mutex_lock(&max8997->iolock); - ret =
>> i2c_smbus_write_i2c_block_data(i2c, reg, count, buf); -
>> mutex_unlock(&max8997->iolock); - if (ret < 0) - return ret;
>> +static const struct regmap_config max8997_regmap_rtc_config = { +
>> .reg_bits = 8, + .val_bits = 8, + .max_register =
>> MAX8997_RTC_REG_END, +};
>>
>> - return 0; -} -EXPORT_SYMBOL_GPL(max8997_bulk_write); +static
>> const struct regmap_config max8997_regmap_haptic_config = { +
>> .reg_bits = 8, + .val_bits = 8, + .max_register =
>> MAX8997_HAPTIC_REG_END, +};
>>
>> -int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8
>> mask) -{ - struct max8997_dev *max8997 = i2c_get_clientdata(i2c); -
>> int ret; - - mutex_lock(&max8997->iolock); - ret =
>> i2c_smbus_read_byte_data(i2c, reg); - if (ret >= 0) { - u8
>> old_val = ret & 0xff; - u8 new_val = (val & mask) | (old_val &
>> (~mask)); - ret = i2c_smbus_write_byte_data(i2c, reg, new_val); - }
>> - mutex_unlock(&max8997->iolock); - return ret; -}
>> -EXPORT_SYMBOL_GPL(max8997_update_reg); +static const struct
>> regmap_config max8997_regmap_muic_config = { + .reg_bits = 8, +
>> .val_bits = 8, + .max_register = MAX8997_MUIC_REG_END, +};
>>
>> /* * Only the common platform data elements for max8997 are parsed
>> here from the @@ -209,11 +158,48 @@ static int
>> max8997_i2c_probe(struct i2c_client *i2c,
>>
>> max8997->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC);
>> i2c_set_clientdata(max8997->rtc, max8997); + max8997->haptic =
>> i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC);
>> i2c_set_clientdata(max8997->haptic, max8997); + max8997->muic =
>> i2c_new_dummy(i2c->adapter, I2C_ADDR_MUIC);
>> i2c_set_clientdata(max8997->muic, max8997);
>>
>> + max8997->regmap = devm_regmap_init_i2c(i2c,
>> &max8997_regmap_config); + if (IS_ERR(max8997->regmap)) { + ret =
>> PTR_ERR(max8997->regmap); + dev_err(max8997->dev, + "failed to
>> allocate register map: %d\n", ret); + return ret; + } + +
>> max8997->regmap_rtc = devm_regmap_init_i2c(max8997->rtc, +
>> &max8997_regmap_rtc_config); + if (IS_ERR(max8997->regmap_rtc)) {
>> + ret = PTR_ERR(max8997->regmap_rtc); + dev_err(max8997->dev, +
>> "failed to allocate register map: %d\n", ret); + goto err_regmap;
>> + } + + max8997->regmap_haptic =
>> devm_regmap_init_i2c(max8997->haptic, +
>> &max8997_regmap_haptic_config); + if
>> (IS_ERR(max8997->regmap_haptic)) { + ret =
>> PTR_ERR(max8997->regmap_haptic); + dev_err(max8997->dev, + "failed
>> to allocate register map: %d\n", ret); + goto err_regmap; + } + +
>> max8997->regmap_muic = devm_regmap_init_i2c(max8997->muic, +
>> &max8997_regmap_muic_config); + if (IS_ERR(max8997->regmap_muic)) {
>> + ret = PTR_ERR(max8997->regmap_muic); + dev_err(max8997->dev, +
>> "failed to allocate register map: %d\n", ret); + goto err_regmap;
>> + } + pm_runtime_set_active(max8997->dev);
>>
>> max8997_irq_init(max8997); @@ -238,6 +224,7 @@ static int
>> max8997_i2c_probe(struct i2c_client *i2c,
>>
>> err_mfd: mfd_remove_devices(max8997->dev); +err_regmap:
>> i2c_unregister_device(max8997->muic);
>> i2c_unregister_device(max8997->haptic);
>> i2c_unregister_device(max8997->rtc); @@ -423,15 +410,15 @@ static
>> int max8997_freeze(struct device *dev) int i;
>>
>> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_pmic); i++) -
>> max8997_read_reg(i2c, max8997_dumpaddr_pmic[i], +
>> regmap_read(max8997->regmap, max8997_dumpaddr_pmic[i],
>> &max8997->reg_dump[i]);
>>
>> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_muic); i++) -
>> max8997_read_reg(i2c, max8997_dumpaddr_muic[i], +
>> regmap_read(max8997->regmap_muic, max8997_dumpaddr_muic[i],
>> &max8997->reg_dump[i + MAX8997_REG_PMIC_END]);
>>
>> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_haptic); i++) -
>> max8997_read_reg(i2c, max8997_dumpaddr_haptic[i], +
>> regmap_read(max8997->regmap_haptic, max8997_dumpaddr_haptic[i],
>> &max8997->reg_dump[i + MAX8997_REG_PMIC_END +
>> MAX8997_MUIC_REG_END]);
>
> Code looks good. Idea for another patch: could bulk read be used
> here? At least some of registers have continuous addresses so maybe
> its worth to read them at once?
It's problematic, because address ranges of dumped registers are not
continuous. So it would need to call regmap_bulk_read in loop, which
gives a small gain and complicates the code. I think there is no purpose
to do it. It's better and keep it simple.
>>
>> @@ -445,15 +432,15 @@ static int max8997_restore(struct device
>> *dev) int i;
>>
>> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_pmic); i++) -
>> max8997_write_reg(i2c, max8997_dumpaddr_pmic[i], +
>> regmap_write(max8997->regmap, max8997_dumpaddr_pmic[i],
>> max8997->reg_dump[i]);
>>
>> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_muic); i++) -
>> max8997_write_reg(i2c, max8997_dumpaddr_muic[i], +
>> regmap_write(max8997->regmap_muic, max8997_dumpaddr_muic[i],
>> max8997->reg_dump[i + MAX8997_REG_PMIC_END]);
>>
>> for (i = 0; i < ARRAY_SIZE(max8997_dumpaddr_haptic); i++) -
>> max8997_write_reg(i2c, max8997_dumpaddr_haptic[i], +
>> regmap_write(max8997->regmap_haptic, max8997_dumpaddr_haptic[i],
>> max8997->reg_dump[i + MAX8997_REG_PMIC_END +
>> MAX8997_MUIC_REG_END]);
>
> As above - bulk write (if you still would like to improve things in
> this driver)?
>
Thanks,
Robert
^ permalink raw reply
* Re: [PATCH 3/3] mfd: max8997: move regmap handling to function drivers
From: Krzysztof Kozlowski @ 2014-03-11 15:07 UTC (permalink / raw)
To: Robert Baldyga
Cc: sameo, lee.jones, myungjoo.ham, cw00.choi, dmitry.torokhov,
cooloney, rpurdie, dbaryshkov, dwmw2, lgirdwood, broonie, a.zummo,
paul.gortmaker, linux-kernel, linux-input, linux-leds, rtc-linux,
m.szyprowski
In-Reply-To: <1394546304-15191-4-git-send-email-r.baldyga@samsung.com>
On Tue, 2014-03-11 at 14:58 +0100, Robert Baldyga wrote:
> This patch moves code creating new i2c clients and regmaps to function
> drivers which uses them. It allow to avoid creating this instances when
> intividual function drivers are not enabled.
s/which uses/which use/
s/It allow/ It allows/
s/intividual/individual/
>
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
> drivers/extcon/extcon-max8997.c | 118 +++++++++++++++++++++++++++--
> drivers/input/misc/max8997_haptic.c | 113 ++++++++++++++++++++++-----
> drivers/mfd/max8997.c | 143 -----------------------------------
> drivers/rtc/rtc-max8997.c | 74 ++++++++++++------
> include/linux/mfd/max8997-private.h | 14 ++--
> 5 files changed, 262 insertions(+), 200 deletions(-)
>
> diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
> index 5948061..a71581a 100644
> --- a/drivers/extcon/extcon-max8997.c
> +++ b/drivers/extcon/extcon-max8997.c
> @@ -118,6 +118,9 @@ enum max8997_muic_charger_type {
> struct max8997_muic_info {
> struct device *dev;
> struct max8997_dev *max8997;
> + struct i2c_client *i2c;
> + struct regmap *regmap;
> + struct regmap_irq_chip_data *irq_data;
> struct extcon_dev *edev;
> int prev_cable_type;
> int prev_chg_type;
> @@ -144,6 +147,39 @@ struct max8997_muic_info {
> */
> int path_usb;
> int path_uart;
> +
> + unsigned int reg_dump[MAX8997_MUIC_REG_END];
> +};
> +
> +static const struct regmap_config max8997_muic_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .max_register = MAX8997_MUIC_REG_END,
> +};
> +
> +static const struct regmap_irq max8997_irqs_muic[] = {
> + /* MUIC_INT1 interrupts */
> + { .reg_offset = 0, .mask = MUIC_INT1_ADC_MASK, },
> + { .reg_offset = 0, .mask = MUIC_INT1_ADCLow_MASK, },
> + { .reg_offset = 0, .mask = MUIC_INT1_ADCError_MASK, },
> + /* MUIC_INT2 interrupts */
> + { .reg_offset = 1, .mask = MUIC_INT2_ChgTyp_MASK, },
> + { .reg_offset = 1, .mask = MUIC_INT2_ChgDetRun_MASK, },
> + { .reg_offset = 1, .mask = MUIC_INT2_DCDTmr_MASK, },
> + { .reg_offset = 1, .mask = MUIC_INT2_DBChg_MASK, },
> + { .reg_offset = 1, .mask = MUIC_INT2_VBVolt_MASK, },
> + /* MUIC_INT3 interrupts */
> + { .reg_offset = 2, .mask = MUIC_INT3_OVP_MASK, },
> +};
> +
> +static const struct regmap_irq_chip max8997_muic_irq_chip = {
> + .name = "max8997-muic",
> + .status_base = MAX8997_MUIC_REG_INT1,
> + .mask_base = MAX8997_MUIC_REG_INTMASK1,
> + .mask_invert = true,
> + .num_regs = 3,
> + .irqs = max8997_irqs_muic,
> + .num_irqs = ARRAY_SIZE(max8997_irqs_muic),
> };
>
> enum {
> @@ -191,7 +227,7 @@ static int max8997_muic_set_debounce_time(struct max8997_muic_info *info,
> case ADC_DEBOUNCE_TIME_10MS:
> case ADC_DEBOUNCE_TIME_25MS:
> case ADC_DEBOUNCE_TIME_38_62MS:
> - ret = regmap_update_bits(info->max8997->regmap_muic,
> + ret = regmap_update_bits(info->regmap,
> MAX8997_MUIC_REG_CONTROL3,
> CONTROL3_ADCDBSET_MASK,
> time << CONTROL3_ADCDBSET_SHIFT);
> @@ -229,7 +265,7 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
> else
> ctrl1 = CONTROL1_SW_OPEN;
>
> - ret = regmap_update_bits(info->max8997->regmap_muic,
> + ret = regmap_update_bits(info->regmap,
> MAX8997_MUIC_REG_CONTROL1, COMP_SW_MASK, ctrl1);
> if (ret < 0) {
> dev_err(info->dev, "failed to update MUIC register\n");
> @@ -241,7 +277,7 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
> else
> ctrl2 |= CONTROL2_LOWPWR_MASK; /* LowPwr=1, CPEn=0 */
>
> - ret = regmap_update_bits(info->max8997->regmap_muic,
> + ret = regmap_update_bits(info->regmap,
> MAX8997_MUIC_REG_CONTROL2,
> CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK, ctrl2);
> if (ret < 0) {
> @@ -544,7 +580,7 @@ static void max8997_muic_irq_work(struct work_struct *work)
> if (info->irq == muic_irqs[i].virq)
> irq_type = muic_irqs[i].irq;
>
> - ret = regmap_bulk_read(info->max8997->regmap_muic,
> + ret = regmap_bulk_read(info->regmap,
> MAX8997_MUIC_REG_STATUS1, info->status, 2);
> if (ret) {
> dev_err(info->dev, "failed to read muic register\n");
> @@ -606,7 +642,7 @@ static int max8997_muic_detect_dev(struct max8997_muic_info *info)
> mutex_lock(&info->mutex);
>
> /* Read STATUSx register to detect accessory */
> - ret = regmap_bulk_read(info->max8997->regmap_muic,
> + ret = regmap_bulk_read(info->regmap,
> MAX8997_MUIC_REG_STATUS1, info->status, 2);
> if (ret) {
> dev_err(info->dev, "failed to read MUIC register\n");
> @@ -670,6 +706,27 @@ static int max8997_muic_probe(struct platform_device *pdev)
> info->dev = &pdev->dev;
> info->max8997 = max8997;
>
> + info->i2c = i2c_new_dummy(max8997->i2c->adapter, MAX8997_I2C_ADDR_MUIC);
Consider rebasing your patch on Lee Jones' MFD tree because there are
minor fixes for possible NULL pointer dereference on i2c_new_dummy
error. I didn't mentioned this before as this is actually the first
place where you add such code :). So add with current fixes in
linux-next/MFD tree.
This applies also to other drivers (haptic etc.).
> +
> + info->regmap = devm_regmap_init_i2c(info->i2c,
> + &max8997_muic_regmap_config);
> + if (IS_ERR(info->regmap)) {
> + ret = PTR_ERR(info->regmap);
> + dev_err(info->dev,
> + "failed to allocate register map: %d\n", ret);
> + goto err_regmap;
> + }
> +
> + ret = regmap_add_irq_chip(info->regmap, max8997->irq,
> + IRQF_ONESHOT | IRQF_SHARED |
> + IRQF_TRIGGER_FALLING, 0,
> + &max8997_muic_irq_chip,
> + &info->irq_data);
> + if (ret) {
> + dev_err(info->dev, "failed to add irq chip: %d\n", ret);
> + goto err_regmap;
> + }
> +
Same as in previous patch - please add regmap_del_irq_chip() in error
paths and remove function.
This applies also to other drivers (haptic etc.).
> platform_set_drvdata(pdev, info);
> mutex_init(&info->mutex);
>
> @@ -679,8 +736,7 @@ static int max8997_muic_probe(struct platform_device *pdev)
> struct max8997_muic_irq *muic_irq = &muic_irqs[i];
> unsigned int virq = 0;
>
> - virq = regmap_irq_get_virq(max8997->irq_data_muic,
> - muic_irq->irq);
> + virq = regmap_irq_get_virq(info->irq_data, muic_irq->irq);
> if (!virq) {
> ret = -EINVAL;
> goto err_irq;
> @@ -723,7 +779,7 @@ static int max8997_muic_probe(struct platform_device *pdev)
>
> /* Initialize registers according to platform data */
> for (i = 0; i < muic_pdata->num_init_data; i++) {
> - regmap_write(info->max8997->regmap_muic,
> + regmap_write(info->regmap,
> muic_pdata->init_data[i].addr,
> muic_pdata->init_data[i].data);
> }
> @@ -779,6 +835,8 @@ static int max8997_muic_probe(struct platform_device *pdev)
> err_irq:
> while (--i >= 0)
> free_irq(muic_irqs[i].virq, info);
> +err_regmap:
> + i2c_unregister_device(info->i2c);
> return ret;
> }
>
> @@ -796,10 +854,54 @@ static int max8997_muic_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static u8 max8997_muic_dumpaddr[] = {
> + MAX8997_MUIC_REG_INTMASK1,
> + MAX8997_MUIC_REG_INTMASK2,
> + MAX8997_MUIC_REG_INTMASK3,
> + MAX8997_MUIC_REG_CDETCTRL,
> + MAX8997_MUIC_REG_CONTROL1,
> + MAX8997_MUIC_REG_CONTROL2,
> + MAX8997_MUIC_REG_CONTROL3,
> +};
> +
> +static int max8997_muic_freeze(struct device *dev)
> +{
> + struct platform_device *pdev =
> + container_of(dev, struct platform_device, dev);
> + struct max8997_muic_info *info = platform_get_drvdata(pdev);
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(max8997_muic_dumpaddr); i++)
> + regmap_read(info->regmap, max8997_muic_dumpaddr[i],
> + &info->reg_dump[i]);
> +
> + return 0;
> +}
> +
> +static int max8997_muic_restore(struct device *dev)
> +{
> + struct platform_device *pdev =
> + container_of(dev, struct platform_device, dev);
> + struct max8997_muic_info *info = platform_get_drvdata(pdev);
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(max8997_muic_dumpaddr); i++)
> + regmap_write(info->regmap, max8997_muic_dumpaddr[i],
> + info->reg_dump[i]);
> +
> + return 0;
> +}
> +
> +static const struct dev_pm_ops max8997_muic_pm = {
> + .freeze = max8997_muic_freeze,
> + .restore = max8997_muic_restore,
> +};
> +
Shouldn't it be inside #ifdef CONFIG_PM_SLEEP?
> static struct platform_driver max8997_muic_driver = {
> .driver = {
> .name = DEV_NAME,
> .owner = THIS_MODULE,
> + .pm = &max8997_muic_pm,
> },
> .probe = max8997_muic_probe,
> .remove = max8997_muic_remove,
> diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
> index d3f7079..abb44f3 100644
> --- a/drivers/input/misc/max8997_haptic.c
> +++ b/drivers/input/misc/max8997_haptic.c
> @@ -47,6 +47,8 @@
> struct max8997_haptic {
> struct device *dev;
> struct max8997_dev *max8997;
> + struct i2c_client *i2c;
> + struct regmap *regmap;
> struct input_dev *input_dev;
> struct regulator *regulator;
>
> @@ -66,6 +68,14 @@ struct max8997_haptic {
> unsigned int internal_mode_pattern;
> unsigned int pattern_cycle;
> unsigned int pattern_signal_period;
> +
> + unsigned int reg_dump[MAX8997_HAPTIC_REG_END];
> +};
> +
> +static const struct regmap_config max8997_haptic_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .max_register = MAX8997_HAPTIC_REG_END,
> };
>
> static int max8997_haptic_set_duty_cycle(struct max8997_haptic *chip)
> @@ -87,19 +97,19 @@ static int max8997_haptic_set_duty_cycle(struct max8997_haptic *chip)
> }
> switch (chip->internal_mode_pattern) {
> case 0:
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_SIGPWMDC1, duty_index);
> break;
> case 1:
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_SIGPWMDC2, duty_index);
> break;
> case 2:
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_SIGPWMDC3, duty_index);
> break;
> case 3:
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_SIGPWMDC4, duty_index);
> break;
> default:
> @@ -116,51 +126,49 @@ static void max8997_haptic_configure(struct max8997_haptic *chip)
> value = chip->type << MAX8997_MOTOR_TYPE_SHIFT |
> chip->enabled << MAX8997_ENABLE_SHIFT |
> chip->mode << MAX8997_MODE_SHIFT | chip->pwm_divisor;
> - regmap_write(chip->max8997->regmap_haptic,
> - MAX8997_HAPTIC_REG_CONF2, value);
> + regmap_write(chip->regmap, MAX8997_HAPTIC_REG_CONF2, value);
>
> if (chip->mode == MAX8997_INTERNAL_MODE && chip->enabled) {
> value = chip->internal_mode_pattern << MAX8997_CYCLE_SHIFT |
> chip->internal_mode_pattern << MAX8997_SIG_PERIOD_SHIFT |
> chip->internal_mode_pattern << MAX8997_SIG_DUTY_SHIFT |
> chip->internal_mode_pattern << MAX8997_PWM_DUTY_SHIFT;
> - regmap_write(chip->max8997->regmap_haptic,
> - MAX8997_HAPTIC_REG_DRVCONF, value);
> + regmap_write(chip->regmap, MAX8997_HAPTIC_REG_DRVCONF, value);
>
> switch (chip->internal_mode_pattern) {
> case 0:
> value = chip->pattern_cycle << 4;
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_CYCLECONF1, value);
> value = chip->pattern_signal_period;
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_SIGCONF1, value);
> break;
>
> case 1:
> value = chip->pattern_cycle;
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_CYCLECONF1, value);
> value = chip->pattern_signal_period;
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_SIGCONF2, value);
> break;
>
> case 2:
> value = chip->pattern_cycle << 4;
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_CYCLECONF2, value);
> value = chip->pattern_signal_period;
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_SIGCONF3, value);
> break;
>
> case 3:
> value = chip->pattern_cycle;
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_CYCLECONF2, value);
> value = chip->pattern_signal_period;
> - regmap_write(chip->max8997->regmap_haptic,
> + regmap_write(chip->regmap,
> MAX8997_HAPTIC_REG_SIGCONF4, value);
> break;
>
> @@ -277,6 +285,17 @@ static int max8997_haptic_probe(struct platform_device *pdev)
> chip->mode = haptic_pdata->mode;
> chip->pwm_divisor = haptic_pdata->pwm_divisor;
>
> + chip->i2c = i2c_new_dummy(iodev->i2c->adapter, MAX8997_I2C_ADDR_HAPTIC);
> +
Return value - use code from linux-next/MFD tree.
> + chip->regmap = devm_regmap_init_i2c(chip->i2c,
> + &max8997_haptic_regmap_config);
> + if (IS_ERR(chip->regmap)) {
> + error = PTR_ERR(chip->regmap);
> + dev_err(chip->dev,
> + "failed to allocate register map: %d\n", error);
> + goto err_free_i2c;
> + }
> +
> switch (chip->mode) {
> case MAX8997_INTERNAL_MODE:
> chip->internal_mode_pattern =
> @@ -294,7 +313,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
> dev_err(&pdev->dev,
> "unable to request PWM for haptic, error: %d\n",
> error);
> - goto err_free_mem;
> + goto err_free_i2c;
> }
> break;
>
> @@ -302,7 +321,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
> dev_err(&pdev->dev,
> "Invalid chip mode specified (%d)\n", chip->mode);
> error = -EINVAL;
> - goto err_free_mem;
> + goto err_free_i2c;
> }
>
> chip->regulator = regulator_get(&pdev->dev, "inmotor");
> @@ -348,6 +367,8 @@ err_put_regulator:
> err_free_pwm:
> if (chip->mode == MAX8997_EXTERNAL_MODE)
> pwm_free(chip->pwm);
> +err_free_i2c:
> + i2c_unregister_device(chip->i2c);
> err_free_mem:
> input_free_device(input_dev);
> kfree(chip);
> @@ -370,6 +391,24 @@ static int max8997_haptic_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static u8 max8997_haptic_dumpaddr[] = {
> + MAX8997_HAPTIC_REG_CONF1,
> + MAX8997_HAPTIC_REG_CONF2,
> + MAX8997_HAPTIC_REG_DRVCONF,
> + MAX8997_HAPTIC_REG_CYCLECONF1,
> + MAX8997_HAPTIC_REG_CYCLECONF2,
> + MAX8997_HAPTIC_REG_SIGCONF1,
> + MAX8997_HAPTIC_REG_SIGCONF2,
> + MAX8997_HAPTIC_REG_SIGCONF3,
> + MAX8997_HAPTIC_REG_SIGCONF4,
> + MAX8997_HAPTIC_REG_SIGDC1,
> + MAX8997_HAPTIC_REG_SIGDC2,
> + MAX8997_HAPTIC_REG_SIGPWMDC1,
> + MAX8997_HAPTIC_REG_SIGPWMDC2,
> + MAX8997_HAPTIC_REG_SIGPWMDC3,
> + MAX8997_HAPTIC_REG_SIGPWMDC4,
> +};
> +
> #ifdef CONFIG_PM_SLEEP
> static int max8997_haptic_suspend(struct device *dev)
> {
> @@ -382,7 +421,41 @@ static int max8997_haptic_suspend(struct device *dev)
> }
> #endif
>
> -static SIMPLE_DEV_PM_OPS(max8997_haptic_pm_ops, max8997_haptic_suspend, NULL);
> +static int max8997_haptic_freeze(struct device *dev)
> +{
> + struct platform_device *pdev =
> + container_of(dev, struct platform_device, dev);
> + struct max8997_haptic *chip = platform_get_drvdata(pdev);
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(max8997_haptic_dumpaddr); i++)
> + regmap_read(chip->regmap, max8997_haptic_dumpaddr[i],
> + &chip->reg_dump[i]);
> +
> + return 0;
> +}
> +
> +static int max8997_haptic_restore(struct device *dev)
> +{
> + struct platform_device *pdev =
> + container_of(dev, struct platform_device, dev);
> + struct max8997_haptic *chip = platform_get_drvdata(pdev);
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(max8997_haptic_dumpaddr); i++)
> + regmap_write(chip->regmap, max8997_haptic_dumpaddr[i],
> + chip->reg_dump[i]);
> +
> + return 0;
> +}
> +
> +static const struct dev_pm_ops max8997_haptic_pm = {
> +#ifdef CONFIG_PM_SLEEP
> + .suspend = max8997_haptic_suspend,
> +#endif
> + .freeze = max8997_haptic_freeze,
> + .restore = max8997_haptic_restore,
> +};
Freeze should be also in CONFIG_PM_SLEEP.
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH 1/3] mfd: max8997: use regmap to access registers
From: Krzysztof Kozlowski @ 2014-03-11 15:20 UTC (permalink / raw)
To: Robert Baldyga
Cc: sameo, lee.jones, myungjoo.ham, cw00.choi, dmitry.torokhov,
cooloney, rpurdie, dbaryshkov, dwmw2, lgirdwood, broonie, a.zummo,
paul.gortmaker, linux-kernel, linux-input, linux-leds, rtc-linux,
m.szyprowski
In-Reply-To: <531F24C0.3070603@samsung.com>
On Tue, 2014-03-11 at 15:59 +0100, Robert Baldyga wrote:
> >> @@ -180,12 +167,12 @@ static struct irq_chip max8997_irq_chip = {
> >> static irqreturn_t max8997_irq_thread(int irq, void *data) {
> >> struct max8997_dev *max8997 = data; - u8
> >> irq_reg[MAX8997_IRQ_GROUP_NR] = {}; - u8 irq_src; + unsigned int
> >> irq_reg[MAX8997_IRQ_GROUP_NR] = {}; + unsigned int irq_src; int
> >> ret; int i, cur_irq;
> >>
> >> - ret = max8997_read_reg(max8997->i2c, MAX8997_REG_INTSRC,
> >> &irq_src); + ret = regmap_read(max8997->regmap,
> >> MAX8997_REG_INTSRC, &irq_src); if (ret < 0) { dev_err(max8997->dev,
> >> "Failed to read interrupt source: %d\n", ret); @@ -194,8 +181,9 @@
> >> static irqreturn_t max8997_irq_thread(int irq, void *data)
> >>
> >> if (irq_src & MAX8997_IRQSRC_PMIC) { /* PMIC INT1 ~ INT4 */ -
> >> max8997_bulk_read(max8997->i2c, MAX8997_REG_INT1, 4, -
> >> &irq_reg[PMIC_INT1]); + for (i = 0; i < 4; ++i) +
> >> regmap_read(max8997->regmap, + MAX8997_REG_INT1+i,
> >> &irq_reg[PMIC_INT1+i]);
> >
> > Can't you use here one bulk read instead of 4xregmap_read()?
>
> Mixing regmap_read and regmap_bulk_read is not good idea, because the
> first function returns register value as unsigned int, but the second
> returns reg value to each single byte. So it would need to do some
> additional operations, and makes things more complicated.
The only mixing I see would be in reading FLASHSTATUS register which
could be resolved with:
if (irq_src & MAX8997_IRQSRC_FLASH) {
/* Flash Status Interrupt */
unsigned int data;
ret = regmap_read(max8997->regmap, MAX8997_REG_FLASHSTATUS,
&data);
irq_reg[FLASH_STATUS] = data;
}
This isn't more complicated than replacing bulk read with a loop :).
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH 1/2] Revert "HID: microsoft: Add ID's for Surface Type/Touch, Cover 2"
From: Jiri Kosina @ 2014-03-11 15:54 UTC (permalink / raw)
To: Benjamin Tissoires; +Cc: Derya, linux-input
In-Reply-To: <20140310202219.GA4125@mail.corp.redhat.com>
On Mon, 10 Mar 2014, Benjamin Tissoires wrote:
> > The MS Surface Pro 2 has an USB composite device with 3 interfaces
> > - interface 0 - sensor hub
> > - interface 1 - wacom digitizer
> > - interface 2 - the keyboard cover, if one is attached
> > This USB composite device changes it product id dependent on if and which
> > keyboard cover is attached. Adding the covers to hid_have_special_driver
> > prevents loading the right hid drivers for the other two interfaces, all 3
> > get loaded with hid-microsoft. We don't even need hid-microsoft for the
> > keyboards. We have to revert this to load the right hid modules for each
> > interface.
> >
> > Signed-off-by: Derya <derya.kiran@yahoo.de>
>
> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>
> Hoewever, Derya, you should reconsider re-sending the whole series
> through "git send-email" or configuring your e-mail client according to
> Documentation/email-clients.txt . This series has the lines wrapped and
> tabs are converted to spaces, which means that Jiri ca not take the
> patch without reformatting them to his tree.
Indeed, the patches have been mangled by your mail client beyond repair.
Could you please resend them (and include Benjamin's Ack), so that I can
queue them?
Thanks!
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [lxc-devel] [systemd-devel] Suspending access to opened/active /dev/nodes during application runtime
From: Oren Laadan @ 2014-03-11 16:02 UTC (permalink / raw)
To: LXC development mailing-list
Cc: systemd-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
libvir-list-H+wXaHxf7aLQT0dZR+AlfA, Linux Containers,
linux-input-u79uwXL29TY76Z2rM5mHXA, linux-kernel, David Herrmann,
Lennart Poettering
In-Reply-To: <9E972401-6FA3-439B-9531-49D1FCC8D61D-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Fri, Mar 7, 2014 at 3:51 PM, Lukasz Pawelczyk <havner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> On 7 Mar 2014, at 20:24, Lennart Poettering <mzerqung-uLTowLwuiw4b1SvskN2V4Q@public.gmane.org> wrote:
>
> > On Fri, 07.03.14 19:45, Lukasz Pawelczyk (havner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org) wrote:
> >
> >> Problem:
> >> Has anyone thought about a mechanism to limit/remove an access to a
> >> device during an application runtime? Meaning we have an application
> >> that has an open file descriptor to some /dev/node and depending on
> >> *something* it gains or looses the access to it gracefully (with or
> >> without a notification, but without any fatal consequences).
> >
> > logind can mute input devices as sessions are switched, to enable
> > unpriviliged X11 and wayland compositors.
>
> Would you please elaborate on this? Where is this mechanism? How does it
> work without kernel space support? Is there some kernel space support I'm
> not aware of?
>
> >> Example:
> >> LXC. Imagine we have 2 separate containers. Both running full operating
> >> systems. Specifically with 2 X servers. Both running concurrently of
> >
> > Well, devices are not namespaced on Linux (with the single exception of
> > network devices). An X server needs device access, hence this doesn't
> > fly at all.
> >
> > When you enumerate devices with libudev in a container they will never
> > be marked as "initialized" and you do not get any udev hotplug events in
> > containers, and you don#t have the host's udev db around, nor would it
> > make any sense to you if you had. X11 and friends rely on udev
> > however...
> >
> > Before you think about doing something like this, you need to fix the
> > kernel to provide namespaced devices (good luck!)
>
> Precisly! That's the generic idea. I'm not for implementing it though at
> this moment. I just wanted to know whether anybody actually though about it
> or maybe someone is interested in starting such a work, etc.
>
Yes, we have started such a thing. Here is the link to the wiki:
https://github.com/Cellrox/devns-patches/wiki
[...]
Oren.
^ permalink raw reply
* Re: [PATCH v5 0/9] Use regmap+devm+DT in pm8xxx input drivers
From: Stephen Boyd @ 2014-03-11 17:50 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Josh Cartwright,
linux-input, devicetree@vger.kernel.org
In-Reply-To: <1393958088-1456-1-git-send-email-sboyd@codeaurora.org>
ping?
On 03/04/14 10:34, Stephen Boyd wrote:
> These patches move the pm8xxx input drivers over to use devm_* APIs
> and regmap. This breaks the dependency of these drivers on the pm8xxx
> specific read/write calls and also simplifies the probe code a bit.
> Finally we add devicetree support to these drivers so they can be probed
> on the platforms that are supported upstream.
>
> Changes since v4:
> * Added reg property to bindings
> * Added linux,* properties to keypad binding
>
> Changes since v3:
> * Dropped devm conversion patch for pwrkey
> * Fixed compilation of keypad
>
> Changes since v2:
> * Rebased to v3.14-rc3
>
> Changes since v1:
> * Picked up Dmitry's version of devm for pwrkey
> * Added DT bindings and parsing patches
> * Dropped patches picked up by Dmitry
>
> Stephen Boyd (9):
> Input: pmic8xxx-keypad - Fix build by removing gpio configuration
> Input: pmic8xxx-keypad - Migrate to devm_* APIs
> Input: pmic8xxx-keypad - Migrate to regmap APIs
> Input: pmic8xxx-keypad - Migrate to DT
> Input: pmic8xxx-pwrkey - Migrate to DT
> Input: pm8xxx-vibrator - Add DT match table
> devicetree: bindings: Document PM8921/8058 keypads
> devicetree: bindings: Document PM8921/8058 power keys
> devicetree: bindings: Document PM8921/8058 vibrators
>
> .../bindings/input/qcom,pm8xxx-keypad.txt | 89 ++++++
> .../bindings/input/qcom,pm8xxx-pwrkey.txt | 46 +++
> .../devicetree/bindings/input/qcom,pm8xxx-vib.txt | 22 ++
> drivers/input/keyboard/pmic8xxx-keypad.c | 348 ++++++++-------------
> drivers/input/misc/pm8xxx-vibrator.c | 8 +
> drivers/input/misc/pmic8xxx-pwrkey.c | 33 +-
> include/linux/input/pmic8xxx-keypad.h | 52 ---
> include/linux/input/pmic8xxx-pwrkey.h | 31 --
> 8 files changed, 316 insertions(+), 313 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
> create mode 100644 Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt
> create mode 100644 Documentation/devicetree/bindings/input/qcom,pm8xxx-vib.txt
> delete mode 100644 include/linux/input/pmic8xxx-keypad.h
> delete mode 100644 include/linux/input/pmic8xxx-pwrkey.h
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply
* [PATCH] Input: fix dependencies of OLPC AP-SP driver
From: Jean Delvare @ 2014-03-11 18:42 UTC (permalink / raw)
To: linux-input; +Cc: Dmitry Torokhov
I don't think the OLPC AP-SP driver is generally useful without OLPC
support. So make it depend on OLPC, unless build testing is enabled.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/serio/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-3.14-rc6.orig/drivers/input/serio/Kconfig 2014-02-09 16:53:02.931633818 +0100
+++ linux-3.14-rc6/drivers/input/serio/Kconfig 2014-03-11 18:52:42.280541110 +0100
@@ -263,7 +263,7 @@ config SERIO_APBPS2
config SERIO_OLPC_APSP
tristate "OLPC AP-SP input support"
- depends on OF
+ depends on OLPC || (OF && COMPILE_TEST)
help
Say Y here if you want support for the keyboard and touchpad included
in the OLPC XO-1.75 and XO-4 laptops.
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply
* [PATCH] atkbd: Samsung NP530U3C laptop forced key release
From: Arkadiusz Bokowy @ 2014-03-11 18:54 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
atkbd: Samsung NP530U3C laptop forced key release
For Samsung NP530U3C laptop (observed on firmware P09ABH) not all Fn keys
generates release event, which leaves key in a pressed state. This patch
adds those keys into the "forced release" workaround. Fixed keys: WLAN,
Settings, Fn Lock.
Patch generated for kernel version 3.13.6
Signed-off-by: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
---
--- linux-3.13.6/drivers/input/keyboard/atkbd.c.orig 2014-03-07 07:07:02.000000000 +0100
+++ linux-3.13.6/drivers/input/keyboard/atkbd.c 2014-03-11 18:48:47.593211190 +0100
@@ -943,6 +943,13 @@ static unsigned int atkbd_samsung_forced
};
/*
+ * Samsung NP530U3C key release for WLAN, Settings and Fn Lock
+ */
+static unsigned int atkbd_samsung_np530_forced_release_keys[] = {
+ 0xa8, 0xa9, 0xce, 0xd5, -1U
+};
+
+/*
* Amilo Pi 3525 key release for Fn+Volume keys not working
*/
static unsigned int atkbd_amilo_pi3525_forced_release_keys[] = {
@@ -1732,6 +1739,15 @@ static const struct dmi_system_id atkbd_
.driver_data = atkbd_samsung_forced_release_keys,
},
{
+ /* Samsung NP530U3C */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "530U3C"),
+ },
+ .callback = atkbd_setup_forced_release,
+ .driver_data = atkbd_samsung_np530_forced_release_keys,
+ },
+ {
/* Fujitsu Amilo PA 1510 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
^ permalink raw reply
* Re: Re: [PATCH 6/7] regulator: AXP20x: Add support for regulators subsystem
From: Carlo Caione @ 2014-03-11 19:24 UTC (permalink / raw)
To: Mark Brown
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw,
maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
hdegoede-H+wXaHxf7aLQT0dZR+AlfA, emilio-0Z03zUJReD5OxF6Tv1QG9Q,
wens-jdAy2FN1RRM, sameo-VuQAYsv1563Yd54FQh9/CA,
lee.jones-QSEj5FYQhm4dnm+yROfE0A,
devicetree-u79uwXL29TY76Z2rM5mHXA,
dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
lgirdwood-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <20140303015616.GN2411-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
On Mon, Mar 03, 2014 at 10:56:16AM +0900, Mark Brown wrote:
<snip>
> > + np = of_node_get(pdev->dev.parent->of_node);
> > + if (!np)
> > + return 0;
> > +
> > + regulators = of_find_node_by_name(np, "regulators");
> > + if (!regulators) {
> > + dev_err(&pdev->dev, "regulators node not found\n");
> > + return -EINVAL;
> > + }
>
> The driver should be able to start up with no configuration provided at
> all except for the device being registered - the user won't be able to
> change anything but they will be able to read the current state of the
> hardware which can be useful for diagnostics.
If the device is DT enabled and no configuration is provided for
regulators, these are disabled according to:
http://lxr.linux.no/linux+v3.13.5/drivers/regulator/core.c#L3797
Am I missing something or do you have any pointer?
Thanks,
--
Carlo Caione
^ permalink raw reply
* Re: Re: [PATCH 6/7] regulator: AXP20x: Add support for regulators subsystem
From: Mark Brown @ 2014-03-11 19:29 UTC (permalink / raw)
To: Carlo Caione
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw,
maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
hdegoede-H+wXaHxf7aLQT0dZR+AlfA, emilio-0Z03zUJReD5OxF6Tv1QG9Q,
wens-jdAy2FN1RRM, sameo-VuQAYsv1563Yd54FQh9/CA,
lee.jones-QSEj5FYQhm4dnm+yROfE0A,
devicetree-u79uwXL29TY76Z2rM5mHXA,
dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
lgirdwood-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <20140311192411.GA4193-bi+AKbBUZKZeIdyRz4JgOMwOAu8XWILU@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 927 bytes --]
On Tue, Mar 11, 2014 at 08:24:11PM +0100, Carlo Caione wrote:
> On Mon, Mar 03, 2014 at 10:56:16AM +0900, Mark Brown wrote:
> > > + regulators = of_find_node_by_name(np, "regulators");
> > > + if (!regulators) {
> > > + dev_err(&pdev->dev, "regulators node not found\n");
> > > + return -EINVAL;
> > > + }
> > The driver should be able to start up with no configuration provided at
> > all except for the device being registered - the user won't be able to
> > change anything but they will be able to read the current state of the
> > hardware which can be useful for diagnostics.
> If the device is DT enabled and no configuration is provided for
> regulators, these are disabled according to:
> http://lxr.linux.no/linux+v3.13.5/drivers/regulator/core.c#L3797
> Am I missing something or do you have any pointer?
With the above code the driver will return an error and never get as far
as registering the regulator.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox