From 75e8cd349d222f5a6829c3630d10c21be1e2a83c Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 21 Oct 2014 14:33:38 +0200 Subject: [PATCH] projects/RPi/patches/linux: update RPi support patch Signed-off-by: Stephan Raue --- .../patches/linux/linux-01-RPi_support.patch | 3805 ++++------------- 1 file changed, 805 insertions(+), 3000 deletions(-) diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index c6d9fff372..761ef49251 100644 --- a/projects/RPi/patches/linux/linux-01-RPi_support.patch +++ b/projects/RPi/patches/linux/linux-01-RPi_support.patch @@ -1,7 +1,7 @@ From 7f91d1a92bb546612ff6766f1ec75826cf483ad9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 01/82] Main bcm2708 linux port +Subject: [PATCH 01/75] Main bcm2708 linux port Signed-off-by: popcornmix --- @@ -5120,7 +5120,7 @@ index 09ebe57..582ce64 100644 From 19d789c43ab2b18b37ee9ea76d5100faf3a3673b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Oct 2014 18:50:05 +0100 -Subject: [PATCH 02/82] Add bcm2708_gpio driver +Subject: [PATCH 02/75] Add bcm2708_gpio driver Signed-off-by: popcornmix @@ -5682,7 +5682,7 @@ index 0000000..fb69624 From 60215ba646e6b3b2cdc9d61b283de53cf96b3358 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 7 May 2013 22:20:24 +0100 -Subject: [PATCH 03/82] Add quick config. +Subject: [PATCH 03/75] Add quick config. This is designed for quick compiling when developing. No modules are needed and it includes all Pi specific drivers @@ -5898,7 +5898,7 @@ index 0000000..e5efe75 From d6ed20c144ed3a83747f2bc27130a8f74b91ffe9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 04/82] Add dwc_otg driver +Subject: [PATCH 04/75] Add dwc_otg driver Signed-off-by: popcornmix @@ -63011,7 +63011,7 @@ index 0000000..cdc9963 From 1409f72285e830413ddcb46ae8e8cacc5a5ca77d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 05/82] bcm2708 watchdog driver +Subject: [PATCH 05/75] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -63442,7 +63442,7 @@ index 0000000..8a27d68 From 292907b0937a222dd53ac17cdf3fb495d441536b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:55:09 +0100 -Subject: [PATCH 06/82] bcm2708 framebuffer driver +Subject: [PATCH 06/75] bcm2708 framebuffer driver Signed-off-by: popcornmix --- @@ -66489,7 +66489,7 @@ index 3c14e43..7626beb 100644 From f045a809d32f2a376e9520d61bffd0a607d79903 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 07/82] Speed up console framebuffer imageblit function +Subject: [PATCH 07/75] Speed up console framebuffer imageblit function Especially on platforms with a slower CPU but a relatively high framebuffer fill bandwidth, like current ARM devices, the existing @@ -66701,7 +66701,7 @@ index a2bb276..436494f 100644 From b517c335008c58056c0fc0693840b2906a4c6d10 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 08/82] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 08/75] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -66797,7 +66797,7 @@ index fb795c3..fa72af0 100644 From 81c3864101489fa5be7656d5ef19f5841a843b44 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 16:00:25 +0300 -Subject: [PATCH 09/82] bcm2708_fb: DMA acceleration for fb_copyarea +Subject: [PATCH 09/75] bcm2708_fb: DMA acceleration for fb_copyarea Based on http://www.raspberrypi.org/phpBB3/viewtopic.php?p=62425#p62425 Also used Simon's dmaer_master module as a reference for tweaking DMA @@ -67281,10 +67281,10 @@ index 54cd760..b3b1e04 100644 return 0; -From 1de03fcd31d206282898620c182cfaa1751bd7c5 Mon Sep 17 00:00:00 2001 +From d87931ceecc33e2cc9e95185afb3225ec0d15e7a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 10/82] bcm2708 vchiq driver +Subject: [PATCH 10/75] bcm2708 vchiq driver Signed-off-by: popcornmix @@ -67316,6 +67316,8 @@ This commit also introduces vchi_service_set_option and the associated option VCHI_SERVICE_OPTION_TRACE. vchiq: Make the synchronous-CLOSE logic more tolerant + +vchiq: Move logging control into debugfs --- drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + @@ -67331,26 +67333,27 @@ vchiq: Make the synchronous-CLOSE logic more tolerant .../misc/vc04_services/interface/vchiq_arm/vchiq.h | 40 + .../vc04_services/interface/vchiq_arm/vchiq_2835.h | 42 + .../interface/vchiq_arm/vchiq_2835_arm.c | 561 +++ - .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 2907 +++++++++++++++ - .../vc04_services/interface/vchiq_arm/vchiq_arm.h | 212 ++ + .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 2883 +++++++++++++++ + .../vc04_services/interface/vchiq_arm/vchiq_arm.h | 223 ++ .../interface/vchiq_arm/vchiq_build_info.h | 37 + .../vc04_services/interface/vchiq_arm/vchiq_cfg.h | 66 + .../interface/vchiq_arm/vchiq_connected.c | 119 + .../interface/vchiq_arm/vchiq_connected.h | 50 + .../vc04_services/interface/vchiq_arm/vchiq_core.c | 3859 ++++++++++++++++++++ .../vc04_services/interface/vchiq_arm/vchiq_core.h | 711 ++++ + .../interface/vchiq_arm/vchiq_debugfs.c | 383 ++ + .../interface/vchiq_arm/vchiq_debugfs.h | 52 + .../interface/vchiq_arm/vchiq_genversion | 87 + .../vc04_services/interface/vchiq_arm/vchiq_if.h | 189 + .../interface/vchiq_arm/vchiq_ioctl.h | 131 + .../interface/vchiq_arm/vchiq_kern_lib.c | 456 +++ .../interface/vchiq_arm/vchiq_memdrv.h | 71 + .../interface/vchiq_arm/vchiq_pagelist.h | 58 + - .../vc04_services/interface/vchiq_arm/vchiq_proc.c | 253 ++ .../vc04_services/interface/vchiq_arm/vchiq_shim.c | 853 +++++ .../vc04_services/interface/vchiq_arm/vchiq_util.c | 151 + .../vc04_services/interface/vchiq_arm/vchiq_util.h | 81 + .../interface/vchiq_arm/vchiq_version.c | 59 + - 33 files changed, 12442 insertions(+) + 34 files changed, 12611 insertions(+) create mode 100644 drivers/misc/vc04_services/Kconfig create mode 100644 drivers/misc/vc04_services/Makefile create mode 100644 drivers/misc/vc04_services/interface/vchi/connections/connection.h @@ -67371,13 +67374,14 @@ vchiq: Make the synchronous-CLOSE logic more tolerant create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h + create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c + create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h - create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h @@ -67424,7 +67428,7 @@ index 0000000..2663933 + are included in the build, N otherwise. diff --git a/drivers/misc/vc04_services/Makefile b/drivers/misc/vc04_services/Makefile new file mode 100644 -index 0000000..4224f58 +index 0000000..0c82520 --- /dev/null +++ b/drivers/misc/vc04_services/Makefile @@ -0,0 +1,17 @@ @@ -67437,7 +67441,7 @@ index 0000000..4224f58 + interface/vchiq_arm/vchiq_arm.o \ + interface/vchiq_arm/vchiq_kern_lib.o \ + interface/vchiq_arm/vchiq_2835_arm.o \ -+ interface/vchiq_arm/vchiq_proc.o \ ++ interface/vchiq_arm/vchiq_debugfs.o \ + interface/vchiq_arm/vchiq_shim.o \ + interface/vchiq_arm/vchiq_util.o \ + interface/vchiq_arm/vchiq_connected.o \ @@ -69571,11 +69575,12 @@ index 0000000..b3bdaa2 +} diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c new file mode 100644 -index 0000000..b7269909 +index 0000000..2596818 --- /dev/null +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -0,0 +1,2907 @@ +@@ -0,0 +1,2883 @@ +/** ++ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved. + * Copyright (c) 2010-2012 Broadcom. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without @@ -69621,11 +69626,11 @@ index 0000000..b7269909 +#include +#include +#include -+#include + +#include "vchiq_core.h" +#include "vchiq_ioctl.h" +#include "vchiq_arm.h" ++#include "vchiq_debugfs.h" + +#define DEVICE_NAME "vchiq" + @@ -69681,8 +69686,6 @@ index 0000000..b7269909 + + +static void suspend_timer_callback(unsigned long context); -+static int vchiq_proc_add_instance(VCHIQ_INSTANCE_T instance); -+static void vchiq_proc_remove_instance(VCHIQ_INSTANCE_T instance); + + +typedef struct user_service_struct { @@ -69721,11 +69724,12 @@ index 0000000..b7269909 + int pid; + int mark; + int use_close_delivered; ++ int trace; + + struct list_head bulk_waiter_list; + struct mutex bulk_waiter_list_mutex; + -+ struct proc_dir_entry *proc_entry; ++ VCHIQ_DEBUGFS_NODE_T debugfs_node; +}; + +typedef struct dump_context_struct { @@ -70711,7 +70715,7 @@ index 0000000..b7269909 + instance->state = state; + instance->pid = current->tgid; + -+ ret = vchiq_proc_add_instance(instance); ++ ret = vchiq_debugfs_add_instance(instance); + if (ret != 0) { + kfree(instance); + return ret; @@ -70864,7 +70868,7 @@ index 0000000..b7269909 + } + } + -+ vchiq_proc_remove_instance(instance); ++ vchiq_debugfs_remove_instance(instance); + + kfree(instance); + file->private_data = NULL; @@ -72118,6 +72122,52 @@ index 0000000..b7269909 + return vchiq_release_internal(service->state, service); +} + ++VCHIQ_DEBUGFS_NODE_T * ++vchiq_instance_get_debugfs_node(VCHIQ_INSTANCE_T instance) ++{ ++ return &instance->debugfs_node; ++} ++ ++int ++vchiq_instance_get_use_count(VCHIQ_INSTANCE_T instance) ++{ ++ VCHIQ_SERVICE_T *service; ++ int use_count = 0, i; ++ i = 0; ++ while ((service = next_service_by_instance(instance->state, ++ instance, &i)) != NULL) { ++ use_count += service->service_use_count; ++ unlock_service(service); ++ } ++ return use_count; ++} ++ ++int ++vchiq_instance_get_pid(VCHIQ_INSTANCE_T instance) ++{ ++ return instance->pid; ++} ++ ++int ++vchiq_instance_get_trace(VCHIQ_INSTANCE_T instance) ++{ ++ return instance->trace; ++} ++ ++void ++vchiq_instance_set_trace(VCHIQ_INSTANCE_T instance, int trace) ++{ ++ VCHIQ_SERVICE_T *service; ++ int i; ++ i = 0; ++ while ((service = next_service_by_instance(instance->state, ++ instance, &i)) != NULL) { ++ service->trace = trace; ++ unlock_service(service); ++ } ++ instance->trace = (trace != 0); ++} ++ +static void suspend_timer_callback(unsigned long context) +{ + VCHIQ_STATE_T *state = (VCHIQ_STATE_T *)context; @@ -72333,10 +72383,10 @@ index 0000000..b7269909 + int err; + void *ptr_err; + -+ /* create proc entries */ -+ err = vchiq_proc_init(); ++ /* create debugfs entries */ ++ err = vchiq_debugfs_init(); + if (err != 0) -+ goto failed_proc_init; ++ goto failed_debugfs_init; + + err = alloc_chrdev_region(&vchiq_devid, VCHIQ_MINOR, 1, DEVICE_NAME); + if (err != 0) { @@ -72386,82 +72436,12 @@ index 0000000..b7269909 +failed_cdev_add: + unregister_chrdev_region(vchiq_devid, 1); +failed_alloc_chrdev: -+ vchiq_proc_deinit(); -+failed_proc_init: ++ vchiq_debugfs_deinit(); ++failed_debugfs_init: + vchiq_log_warning(vchiq_arm_log_level, "could not load vchiq"); + return err; +} + -+static int vchiq_instance_get_use_count(VCHIQ_INSTANCE_T instance) -+{ -+ VCHIQ_SERVICE_T *service; -+ int use_count = 0, i; -+ i = 0; -+ while ((service = next_service_by_instance(instance->state, -+ instance, &i)) != NULL) { -+ use_count += service->service_use_count; -+ unlock_service(service); -+ } -+ return use_count; -+} -+ -+/* read the per-process use-count */ -+static int proc_read_use_count(char *page, char **start, -+ off_t off, int count, -+ int *eof, void *data) -+{ -+ VCHIQ_INSTANCE_T instance = data; -+ int len, use_count; -+ -+ use_count = vchiq_instance_get_use_count(instance); -+ len = snprintf(page+off, count, "%d\n", use_count); -+ -+ return len; -+} -+ -+/* add an instance (process) to the proc entries */ -+static int vchiq_proc_add_instance(VCHIQ_INSTANCE_T instance) -+{ -+#if 1 -+ return 0; -+#else -+ char pidstr[32]; -+ struct proc_dir_entry *top, *use_count; -+ struct proc_dir_entry *clients = vchiq_clients_top(); -+ int pid = instance->pid; -+ -+ snprintf(pidstr, sizeof(pidstr), "%d", pid); -+ top = proc_mkdir(pidstr, clients); -+ if (!top) -+ goto fail_top; -+ -+ use_count = create_proc_read_entry("use_count", -+ 0444, top, -+ proc_read_use_count, -+ instance); -+ if (!use_count) -+ goto fail_use_count; -+ -+ instance->proc_entry = top; -+ -+ return 0; -+ -+fail_use_count: -+ remove_proc_entry(top->name, clients); -+fail_top: -+ return -ENOMEM; -+#endif -+} -+ -+static void vchiq_proc_remove_instance(VCHIQ_INSTANCE_T instance) -+{ -+#if 0 -+ struct proc_dir_entry *clients = vchiq_clients_top(); -+ remove_proc_entry("use_count", instance->proc_entry); -+ remove_proc_entry(instance->proc_entry->name, clients); -+#endif -+} -+ +/**************************************************************************** +* +* vchiq_exit - called when the module is unloaded. @@ -72484,11 +72464,12 @@ index 0000000..b7269909 +MODULE_AUTHOR("Broadcom Corporation"); diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h new file mode 100644 -index 0000000..75ad4c6 +index 0000000..d1e2741 --- /dev/null +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h -@@ -0,0 +1,212 @@ +@@ -0,0 +1,223 @@ +/** ++ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved. + * Copyright (c) 2010-2012 Broadcom. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without @@ -72528,6 +72509,7 @@ index 0000000..75ad4c6 +#include +#include +#include "vchiq_core.h" ++#include "vchiq_debugfs.h" + + +enum vc_suspend_status { @@ -72645,8 +72627,7 @@ index 0000000..75ad4c6 + +extern void +vchiq_check_suspend(VCHIQ_STATE_T *state); -+ -+extern VCHIQ_STATUS_T ++ VCHIQ_STATUS_T +vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle); + +extern VCHIQ_STATUS_T @@ -72682,22 +72663,32 @@ index 0000000..75ad4c6 +extern VCHIQ_STATUS_T +vchiq_release_internal(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service); + -+void ++extern VCHIQ_DEBUGFS_NODE_T * ++vchiq_instance_get_debugfs_node(VCHIQ_INSTANCE_T instance); ++ ++extern int ++vchiq_instance_get_use_count(VCHIQ_INSTANCE_T instance); ++ ++extern int ++vchiq_instance_get_pid(VCHIQ_INSTANCE_T instance); ++ ++extern int ++vchiq_instance_get_trace(VCHIQ_INSTANCE_T instance); ++ ++extern void ++vchiq_instance_set_trace(VCHIQ_INSTANCE_T instance, int trace); ++ ++extern void +set_suspend_state(VCHIQ_ARM_STATE_T *arm_state, + enum vc_suspend_status new_state); + -+void ++extern void +set_resume_state(VCHIQ_ARM_STATE_T *arm_state, + enum vc_resume_status new_state); + -+void ++extern void +start_suspend_timer(VCHIQ_ARM_STATE_T *arm_state); + -+extern int vchiq_proc_init(void); -+extern void vchiq_proc_deinit(void); -+extern struct proc_dir_entry *vchiq_proc_top(void); -+extern struct proc_dir_entry *vchiq_clients_top(void); -+ + +#endif /* VCHIQ_ARM_H */ diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h @@ -77578,6 +77569,453 @@ index 0000000..1b27917 + size_t numBytes); + +#endif +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c +new file mode 100644 +index 0000000..7e03213 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c +@@ -0,0 +1,383 @@ ++/** ++ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved. ++ * Copyright (c) 2010-2012 Broadcom. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++ ++#include ++#include "vchiq_core.h" ++#include "vchiq_arm.h" ++#include "vchiq_debugfs.h" ++ ++#ifdef CONFIG_DEBUG_FS ++ ++/**************************************************************************** ++* ++* log category entries ++* ++***************************************************************************/ ++#define DEBUGFS_WRITE_BUF_SIZE 256 ++ ++#define VCHIQ_LOG_ERROR_STR "error" ++#define VCHIQ_LOG_WARNING_STR "warning" ++#define VCHIQ_LOG_INFO_STR "info" ++#define VCHIQ_LOG_TRACE_STR "trace" ++ ++ ++/* Top-level debug info */ ++struct vchiq_debugfs_info { ++ /* Global 'vchiq' debugfs entry used by all instances */ ++ struct dentry *vchiq_cfg_dir; ++ ++ /* one entry per client process */ ++ struct dentry *clients; ++ ++ /* log categories */ ++ struct dentry *log_categories; ++}; ++ ++static struct vchiq_debugfs_info debugfs_info; ++ ++/* Log category debugfs entries */ ++struct vchiq_debugfs_log_entry { ++ const char *name; ++ int *plevel; ++ struct dentry *dir; ++}; ++ ++static struct vchiq_debugfs_log_entry vchiq_debugfs_log_entries[] = { ++ { "core", &vchiq_core_log_level }, ++ { "msg", &vchiq_core_msg_log_level }, ++ { "sync", &vchiq_sync_log_level }, ++ { "susp", &vchiq_susp_log_level }, ++ { "arm", &vchiq_arm_log_level }, ++}; ++static int n_log_entries = ++ sizeof(vchiq_debugfs_log_entries)/sizeof(vchiq_debugfs_log_entries[0]); ++ ++ ++static struct dentry *vchiq_clients_top(void); ++static struct dentry *vchiq_debugfs_top(void); ++ ++static int debugfs_log_show(struct seq_file *f, void *offset) ++{ ++ int *levp = f->private; ++ char *log_value = NULL; ++ ++ switch (*levp) { ++ case VCHIQ_LOG_ERROR: ++ log_value = VCHIQ_LOG_ERROR_STR; ++ break; ++ case VCHIQ_LOG_WARNING: ++ log_value = VCHIQ_LOG_WARNING_STR; ++ break; ++ case VCHIQ_LOG_INFO: ++ log_value = VCHIQ_LOG_INFO_STR; ++ break; ++ case VCHIQ_LOG_TRACE: ++ log_value = VCHIQ_LOG_TRACE_STR; ++ break; ++ default: ++ break; ++ } ++ ++ seq_printf(f, "%s\n", log_value ? log_value : "(null)"); ++ ++ return 0; ++} ++ ++static int debugfs_log_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, debugfs_log_show, inode->i_private); ++} ++ ++static int debugfs_log_write(struct file *file, ++ const char __user *buffer, ++ size_t count, loff_t *ppos) ++{ ++ struct seq_file *f = (struct seq_file *)file->private_data; ++ int *levp = f->private; ++ char kbuf[DEBUGFS_WRITE_BUF_SIZE + 1]; ++ ++ memset(kbuf, 0, DEBUGFS_WRITE_BUF_SIZE + 1); ++ if (count >= DEBUGFS_WRITE_BUF_SIZE) ++ count = DEBUGFS_WRITE_BUF_SIZE; ++ ++ if (copy_from_user(kbuf, buffer, count) != 0) ++ return -EFAULT; ++ kbuf[count - 1] = 0; ++ ++ if (strncmp("error", kbuf, strlen("error")) == 0) ++ *levp = VCHIQ_LOG_ERROR; ++ else if (strncmp("warning", kbuf, strlen("warning")) == 0) ++ *levp = VCHIQ_LOG_WARNING; ++ else if (strncmp("info", kbuf, strlen("info")) == 0) ++ *levp = VCHIQ_LOG_INFO; ++ else if (strncmp("trace", kbuf, strlen("trace")) == 0) ++ *levp = VCHIQ_LOG_TRACE; ++ else ++ *levp = VCHIQ_LOG_DEFAULT; ++ ++ *ppos += count; ++ ++ return count; ++} ++ ++static const struct file_operations debugfs_log_fops = { ++ .owner = THIS_MODULE, ++ .open = debugfs_log_open, ++ .write = debugfs_log_write, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++/* create an entry under /vchiq/log for each log category */ ++static int vchiq_debugfs_create_log_entries(struct dentry *top) ++{ ++ struct dentry *dir; ++ size_t i; ++ int ret = 0; ++ dir = debugfs_create_dir("log", vchiq_debugfs_top()); ++ if (!dir) ++ return -ENOMEM; ++ debugfs_info.log_categories = dir; ++ ++ for (i = 0; i < n_log_entries; i++) { ++ void *levp = (void *)vchiq_debugfs_log_entries[i].plevel; ++ dir = debugfs_create_file(vchiq_debugfs_log_entries[i].name, ++ 0644, ++ debugfs_info.log_categories, ++ levp, ++ &debugfs_log_fops); ++ if (!dir) { ++ ret = -ENOMEM; ++ break; ++ } ++ ++ vchiq_debugfs_log_entries[i].dir = dir; ++ } ++ return ret; ++} ++ ++static int debugfs_usecount_show(struct seq_file *f, void *offset) ++{ ++ VCHIQ_INSTANCE_T instance = f->private; ++ int use_count; ++ ++ use_count = vchiq_instance_get_use_count(instance); ++ seq_printf(f, "%d\n", use_count); ++ ++ return 0; ++} ++ ++static int debugfs_usecount_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, debugfs_usecount_show, inode->i_private); ++} ++ ++static const struct file_operations debugfs_usecount_fops = { ++ .owner = THIS_MODULE, ++ .open = debugfs_usecount_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++static int debugfs_trace_show(struct seq_file *f, void *offset) ++{ ++ VCHIQ_INSTANCE_T instance = f->private; ++ int trace; ++ ++ trace = vchiq_instance_get_trace(instance); ++ seq_printf(f, "%s\n", trace ? "Y" : "N"); ++ ++ return 0; ++} ++ ++static int debugfs_trace_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, debugfs_trace_show, inode->i_private); ++} ++ ++static int debugfs_trace_write(struct file *file, ++ const char __user *buffer, ++ size_t count, loff_t *ppos) ++{ ++ struct seq_file *f = (struct seq_file *)file->private_data; ++ VCHIQ_INSTANCE_T instance = f->private; ++ char firstchar; ++ ++ if (copy_from_user(&firstchar, buffer, 1) != 0) ++ return -EFAULT; ++ ++ switch (firstchar) { ++ case 'Y': ++ case 'y': ++ case '1': ++ vchiq_instance_set_trace(instance, 1); ++ break; ++ case 'N': ++ case 'n': ++ case '0': ++ vchiq_instance_set_trace(instance, 0); ++ break; ++ default: ++ break; ++ } ++ ++ *ppos += count; ++ ++ return count; ++} ++ ++static const struct file_operations debugfs_trace_fops = { ++ .owner = THIS_MODULE, ++ .open = debugfs_trace_open, ++ .write = debugfs_trace_write, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++/* add an instance (process) to the debugfs entries */ ++int vchiq_debugfs_add_instance(VCHIQ_INSTANCE_T instance) ++{ ++ char pidstr[16]; ++ struct dentry *top, *use_count, *trace; ++ struct dentry *clients = vchiq_clients_top(); ++ ++ snprintf(pidstr, sizeof(pidstr), "%d", ++ vchiq_instance_get_pid(instance)); ++ ++ top = debugfs_create_dir(pidstr, clients); ++ if (!top) ++ goto fail_top; ++ ++ use_count = debugfs_create_file("use_count", ++ 0444, top, ++ instance, ++ &debugfs_usecount_fops); ++ if (!use_count) ++ goto fail_use_count; ++ ++ trace = debugfs_create_file("trace", ++ 0644, top, ++ instance, ++ &debugfs_trace_fops); ++ if (!trace) ++ goto fail_trace; ++ ++ vchiq_instance_get_debugfs_node(instance)->dentry = top; ++ ++ return 0; ++ ++fail_trace: ++ debugfs_remove(use_count); ++fail_use_count: ++ debugfs_remove(top); ++fail_top: ++ return -ENOMEM; ++} ++ ++void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance) ++{ ++ VCHIQ_DEBUGFS_NODE_T *node = vchiq_instance_get_debugfs_node(instance); ++ debugfs_remove_recursive(node->dentry); ++} ++ ++ ++int vchiq_debugfs_init(void) ++{ ++ BUG_ON(debugfs_info.vchiq_cfg_dir != NULL); ++ ++ debugfs_info.vchiq_cfg_dir = debugfs_create_dir("vchiq", NULL); ++ if (debugfs_info.vchiq_cfg_dir == NULL) ++ goto fail; ++ ++ debugfs_info.clients = debugfs_create_dir("clients", ++ vchiq_debugfs_top()); ++ if (!debugfs_info.clients) ++ goto fail; ++ ++ if (vchiq_debugfs_create_log_entries(vchiq_debugfs_top()) != 0) ++ goto fail; ++ ++ return 0; ++ ++fail: ++ vchiq_debugfs_deinit(); ++ vchiq_log_error(vchiq_arm_log_level, ++ "%s: failed to create debugfs directory", ++ __func__); ++ ++ return -ENOMEM; ++} ++ ++/* remove all the debugfs entries */ ++void vchiq_debugfs_deinit(void) ++{ ++ debugfs_remove_recursive(vchiq_debugfs_top()); ++} ++ ++static struct dentry *vchiq_clients_top(void) ++{ ++ return debugfs_info.clients; ++} ++ ++static struct dentry *vchiq_debugfs_top(void) ++{ ++ BUG_ON(debugfs_info.vchiq_cfg_dir == NULL); ++ return debugfs_info.vchiq_cfg_dir; ++} ++ ++#else /* CONFIG_DEBUG_FS */ ++ ++int vchiq_debugfs_init(void) ++{ ++ return 0; ++} ++ ++void vchiq_debugfs_deinit(void) ++{ ++} ++ ++int vchiq_debugfs_add_instance(VCHIQ_INSTANCE_T instance) ++{ ++ return 0; ++} ++ ++void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance) ++{ ++} ++ ++#endif /* CONFIG_DEBUG_FS */ +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h +new file mode 100644 +index 0000000..4d6a378 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h +@@ -0,0 +1,52 @@ ++/** ++ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef VCHIQ_DEBUGFS_H ++#define VCHIQ_DEBUGFS_H ++ ++#include "vchiq_core.h" ++ ++typedef struct vchiq_debugfs_node_struct ++{ ++ struct dentry *dentry; ++} VCHIQ_DEBUGFS_NODE_T; ++ ++int vchiq_debugfs_init(void); ++ ++void vchiq_debugfs_deinit(void); ++ ++int vchiq_debugfs_add_instance(VCHIQ_INSTANCE_T instance); ++ ++void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance); ++ ++#endif /* VCHIQ_DEBUGFS_H */ diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion new file mode 100644 index 0000000..9f5b634 @@ -78606,265 +79044,6 @@ index 0000000..54a3ece +} FRAGMENTS_T; + +#endif /* VCHIQ_PAGELIST_H */ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c -new file mode 100644 -index 0000000..8e59676 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c -@@ -0,0 +1,253 @@ -+/** -+ * Copyright (c) 2010-2012 Broadcom. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions, and the following disclaimer, -+ * without modification. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. The names of the above-listed copyright holders may not be used -+ * to endorse or promote products derived from this software without -+ * specific prior written permission. -+ * -+ * ALTERNATIVELY, this software may be distributed under the terms of the -+ * GNU General Public License ("GPL") version 2, as published by the Free -+ * Software Foundation. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+ -+#include -+#include "vchiq_core.h" -+#include "vchiq_arm.h" -+ -+#if 1 -+ -+int vchiq_proc_init(void) -+{ -+ return 0; -+} -+ -+void vchiq_proc_deinit(void) -+{ -+} -+ -+#else -+ -+struct vchiq_proc_info { -+ /* Global 'vc' proc entry used by all instances */ -+ struct proc_dir_entry *vc_cfg_dir; -+ -+ /* one entry per client process */ -+ struct proc_dir_entry *clients; -+ -+ /* log categories */ -+ struct proc_dir_entry *log_categories; -+}; -+ -+static struct vchiq_proc_info proc_info; -+ -+struct proc_dir_entry *vchiq_proc_top(void) -+{ -+ BUG_ON(proc_info.vc_cfg_dir == NULL); -+ return proc_info.vc_cfg_dir; -+} -+ -+/**************************************************************************** -+* -+* log category entries -+* -+***************************************************************************/ -+#define PROC_WRITE_BUF_SIZE 256 -+ -+#define VCHIQ_LOG_ERROR_STR "error" -+#define VCHIQ_LOG_WARNING_STR "warning" -+#define VCHIQ_LOG_INFO_STR "info" -+#define VCHIQ_LOG_TRACE_STR "trace" -+ -+static int log_cfg_read(char *buffer, -+ char **start, -+ off_t off, -+ int count, -+ int *eof, -+ void *data) -+{ -+ int len = 0; -+ char *log_value = NULL; -+ -+ switch (*((int *)data)) { -+ case VCHIQ_LOG_ERROR: -+ log_value = VCHIQ_LOG_ERROR_STR; -+ break; -+ case VCHIQ_LOG_WARNING: -+ log_value = VCHIQ_LOG_WARNING_STR; -+ break; -+ case VCHIQ_LOG_INFO: -+ log_value = VCHIQ_LOG_INFO_STR; -+ break; -+ case VCHIQ_LOG_TRACE: -+ log_value = VCHIQ_LOG_TRACE_STR; -+ break; -+ default: -+ break; -+ } -+ -+ len += sprintf(buffer + len, -+ "%s\n", -+ log_value ? log_value : "(null)"); -+ -+ return len; -+} -+ -+ -+static int log_cfg_write(struct file *file, -+ const char __user *buffer, -+ unsigned long count, -+ void *data) -+{ -+ int *log_module = data; -+ char kbuf[PROC_WRITE_BUF_SIZE + 1]; -+ -+ (void)file; -+ -+ memset(kbuf, 0, PROC_WRITE_BUF_SIZE + 1); -+ if (count >= PROC_WRITE_BUF_SIZE) -+ count = PROC_WRITE_BUF_SIZE; -+ -+ if (copy_from_user(kbuf, -+ buffer, -+ count) != 0) -+ return -EFAULT; -+ kbuf[count - 1] = 0; -+ -+ if (strncmp("error", kbuf, strlen("error")) == 0) -+ *log_module = VCHIQ_LOG_ERROR; -+ else if (strncmp("warning", kbuf, strlen("warning")) == 0) -+ *log_module = VCHIQ_LOG_WARNING; -+ else if (strncmp("info", kbuf, strlen("info")) == 0) -+ *log_module = VCHIQ_LOG_INFO; -+ else if (strncmp("trace", kbuf, strlen("trace")) == 0) -+ *log_module = VCHIQ_LOG_TRACE; -+ else -+ *log_module = VCHIQ_LOG_DEFAULT; -+ -+ return count; -+} -+ -+/* Log category proc entries */ -+struct vchiq_proc_log_entry { -+ const char *name; -+ int *plevel; -+ struct proc_dir_entry *dir; -+}; -+ -+static struct vchiq_proc_log_entry vchiq_proc_log_entries[] = { -+ { "core", &vchiq_core_log_level }, -+ { "msg", &vchiq_core_msg_log_level }, -+ { "sync", &vchiq_sync_log_level }, -+ { "susp", &vchiq_susp_log_level }, -+ { "arm", &vchiq_arm_log_level }, -+}; -+static int n_log_entries = -+ sizeof(vchiq_proc_log_entries)/sizeof(vchiq_proc_log_entries[0]); -+ -+/* create an entry under /proc/vc/log for each log category */ -+static int vchiq_proc_create_log_entries(struct proc_dir_entry *top) -+{ -+ struct proc_dir_entry *dir; -+ size_t i; -+ int ret = 0; -+ dir = proc_mkdir("log", proc_info.vc_cfg_dir); -+ if (!dir) -+ return -ENOMEM; -+ proc_info.log_categories = dir; -+ -+ for (i = 0; i < n_log_entries; i++) { -+ dir = create_proc_entry(vchiq_proc_log_entries[i].name, -+ 0644, -+ proc_info.log_categories); -+ if (!dir) { -+ ret = -ENOMEM; -+ break; -+ } -+ -+ dir->read_proc = &log_cfg_read; -+ dir->write_proc = &log_cfg_write; -+ dir->data = (void *)vchiq_proc_log_entries[i].plevel; -+ -+ vchiq_proc_log_entries[i].dir = dir; -+ } -+ return ret; -+} -+ -+ -+int vchiq_proc_init(void) -+{ -+ BUG_ON(proc_info.vc_cfg_dir != NULL); -+ -+ proc_info.vc_cfg_dir = proc_mkdir("vc", NULL); -+ if (proc_info.vc_cfg_dir == NULL) -+ goto fail; -+ -+ proc_info.clients = proc_mkdir("clients", -+ proc_info.vc_cfg_dir); -+ if (!proc_info.clients) -+ goto fail; -+ -+ if (vchiq_proc_create_log_entries(proc_info.vc_cfg_dir) != 0) -+ goto fail; -+ -+ return 0; -+ -+fail: -+ vchiq_proc_deinit(); -+ vchiq_log_error(vchiq_arm_log_level, -+ "%s: failed to create proc directory", -+ __func__); -+ -+ return -ENOMEM; -+} -+ -+/* remove all the proc entries */ -+void vchiq_proc_deinit(void) -+{ -+ /* log category entries */ -+ if (proc_info.log_categories) { -+ size_t i; -+ for (i = 0; i < n_log_entries; i++) -+ if (vchiq_proc_log_entries[i].dir) -+ remove_proc_entry( -+ vchiq_proc_log_entries[i].name, -+ proc_info.log_categories); -+ -+ remove_proc_entry(proc_info.log_categories->name, -+ proc_info.vc_cfg_dir); -+ } -+ if (proc_info.clients) -+ remove_proc_entry(proc_info.clients->name, -+ proc_info.vc_cfg_dir); -+ if (proc_info.vc_cfg_dir) -+ remove_proc_entry(proc_info.vc_cfg_dir->name, NULL); -+} -+ -+struct proc_dir_entry *vchiq_clients_top(void) -+{ -+ return proc_info.clients; -+} -+ -+#endif diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c new file mode 100644 index 0000000..72eacdaf @@ -80034,10 +80213,10 @@ index 0000000..b6bfa21 + return vchiq_build_time; +} -From b7c6aa3f2630514ebc7faa4adfd10cd0e01bf9cb Mon Sep 17 00:00:00 2001 +From cac91b9c3fd099e7b9ef2edf5e7241170ceef271 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 12 May 2014 15:12:02 +0100 -Subject: [PATCH 11/82] vchiq: Avoid high load when blocked and unkillable +Subject: [PATCH 11/75] vchiq: Avoid high load when blocked and unkillable vchiq: Include SIGSTOP and SIGCONT in list of signals not-masked by vchiq to allow gdb to work --- @@ -80064,13 +80243,13 @@ index b3bdaa2..7e7b09f 100644 #define MAX_FRAGMENTS (VCHIQ_NUM_CURRENT_BULKS * 2) diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c -index b7269909..98edf1b 100644 +index 2596818..3e328ab 100644 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -49,6 +49,7 @@ - #include "vchiq_core.h" +@@ -50,6 +50,7 @@ #include "vchiq_ioctl.h" #include "vchiq_arm.h" + #include "vchiq_debugfs.h" +#include "vchiq_killable.h" #define DEVICE_NAME "vchiq" @@ -80199,10 +80378,10 @@ index c2eefef..05e7979 100644 static inline int is_pow2(int i) { -From ea12a1f69fc4073a1b96a5cd8e9cb20df3a30626 Mon Sep 17 00:00:00 2001 +From 3d745f564cca0afef6f3a949dab4b92829ca4c36 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 12/82] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 12/75] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix --- @@ -81491,10 +81670,10 @@ index 0000000..5325832 + +#endif /* VC_CMA_H */ -From 0a880716a1d5c8c5c8bec5b961b1e83667e8cd8d Mon Sep 17 00:00:00 2001 +From eb95c4820ddb28d9a9de19dbd0859ba51fe1e62e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 13/82] bcm2708: alsa sound driver +Subject: [PATCH 13/75] bcm2708: alsa sound driver Signed-off-by: popcornmix @@ -81522,12 +81701,12 @@ alsa: reduce severity of expected warning message sound/arm/Kconfig | 7 + sound/arm/Makefile | 5 + sound/arm/bcm2835-ctl.c | 323 ++++++++ - sound/arm/bcm2835-pcm.c | 547 +++++++++++++ + sound/arm/bcm2835-pcm.c | 552 +++++++++++++ sound/arm/bcm2835-vchiq.c | 902 +++++++++++++++++++++ sound/arm/bcm2835.c | 420 ++++++++++ sound/arm/bcm2835.h | 167 ++++ sound/arm/vc_vchi_audioserv_defs.h | 116 +++ - 12 files changed, 2573 insertions(+), 7 deletions(-) + 12 files changed, 2578 insertions(+), 7 deletions(-) create mode 100755 sound/arm/bcm2835-ctl.c create mode 100755 sound/arm/bcm2835-pcm.c create mode 100755 sound/arm/bcm2835-vchiq.c @@ -82069,10 +82248,10 @@ index 0000000..aad905f +} diff --git a/sound/arm/bcm2835-pcm.c b/sound/arm/bcm2835-pcm.c new file mode 100755 -index 0000000..0929e00 +index 0000000..3a20b34f --- /dev/null +++ b/sound/arm/bcm2835-pcm.c -@@ -0,0 +1,547 @@ +@@ -0,0 +1,552 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. +* @@ -82289,15 +82468,20 @@ index 0000000..0929e00 +{ + /* the hardware-specific codes will be here */ + ++ bcm2835_chip_t *chip; ++ struct snd_pcm_runtime *runtime; ++ bcm2835_alsa_stream_t *alsa_stream; ++ + audio_info(" .. IN\n"); -+ bcm2835_chip_t *chip = snd_pcm_substream_chip(substream); ++ ++ chip = snd_pcm_substream_chip(substream); + if(mutex_lock_interruptible(&chip->audio_mutex)) + { + audio_error("Interrupted whilst waiting for lock\n"); + return -EINTR; + } -+ struct snd_pcm_runtime *runtime = substream->runtime; -+ bcm2835_alsa_stream_t *alsa_stream = runtime->private_data; ++ runtime = substream->runtime; ++ alsa_stream = runtime->private_data; + + audio_info("Alsa close\n"); + @@ -84250,10 +84434,10 @@ index 0000000..af3e6eb + +#endif // _VC_AUDIO_DEFS_H_ -From 659f372e3355bb4fc83920f9dcc559d9af7b2726 Mon Sep 17 00:00:00 2001 +From 923f1915faa89e6b8cc7bbc07cc5f3f19b144e38 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 14/82] Add hwrng (hardware random number generator) driver +Subject: [PATCH 14/75] Add hwrng (hardware random number generator) driver --- drivers/char/hw_random/Kconfig | 11 ++++ @@ -84419,10 +84603,10 @@ index 0000000..340f004 +MODULE_DESCRIPTION("BCM2708 H/W Random Number Generator (RNG) driver"); +MODULE_LICENSE("GPL and additional rights"); -From c272b29e5e3d3c32d0c485be53d9d0840c8ef759 Mon Sep 17 00:00:00 2001 +From b945185dd21b40c2eb5b9661cae28a8beccab25e Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 15/82] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 15/75] lirc: added support for RaspberryPi GPIO lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others See: https://github.com/raspberrypi/linux/issues/525 @@ -85170,17 +85354,17 @@ index 0000000..887c36b +module_param(debug, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(debug, "Enable debugging messages"); -From 2d0eafa48750d6f6874d0138bc5492aefc3797ee Mon Sep 17 00:00:00 2001 +From 72f79d825a951a36676a00629110db5e85ae88c1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 16/82] Add cpufreq driver +Subject: [PATCH 16/75] Add cpufreq driver --- arch/arm/Kconfig | 1 + drivers/cpufreq/Kconfig.arm | 8 ++ drivers/cpufreq/Makefile | 1 + - drivers/cpufreq/bcm2835-cpufreq.c | 239 ++++++++++++++++++++++++++++++++++++++ - 4 files changed, 249 insertions(+) + drivers/cpufreq/bcm2835-cpufreq.c | 224 ++++++++++++++++++++++++++++++++++++++ + 4 files changed, 234 insertions(+) create mode 100755 drivers/cpufreq/bcm2835-cpufreq.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig @@ -85228,10 +85412,10 @@ index db6d9a2..a7874d1 100644 diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c new file mode 100755 -index 0000000..7bc55bd +index 0000000..447ca09 --- /dev/null +++ b/drivers/cpufreq/bcm2835-cpufreq.c -@@ -0,0 +1,239 @@ +@@ -0,0 +1,224 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. +* @@ -85297,6 +85481,12 @@ index 0000000..7bc55bd +/* ---------- GLOBALS ---------- */ +static struct cpufreq_driver bcm2835_cpufreq_driver; /* the cpufreq driver global */ + ++static struct cpufreq_frequency_table bcm2835_freq_table[] = { ++ {0, 0, 0}, ++ {0, 0, 0}, ++ {0, 0, CPUFREQ_TABLE_END}, ++}; ++ +/* + =============================================== + clk_rate either gets or sets the clock rates. @@ -85391,78 +85581,57 @@ index 0000000..7bc55bd +static int bcm2835_cpufreq_driver_init(struct cpufreq_policy *policy) +{ + /* measured value of how long it takes to change frequency */ -+ policy->cpuinfo.transition_latency = 355000; /* ns */ ++ const unsigned int transition_latency = 355000; /* ns */ + + /* now find out what the maximum and minimum frequencies are */ -+ policy->min = policy->cpuinfo.min_freq = bcm2835_cpufreq_get_clock(VCMSG_GET_MIN_CLOCK); -+ policy->max = policy->cpuinfo.max_freq = bcm2835_cpufreq_get_clock(VCMSG_GET_MAX_CLOCK); -+ policy->cur = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); ++ bcm2835_freq_table[0].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MIN_CLOCK); ++ bcm2835_freq_table[1].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MAX_CLOCK); + -+ print_info("min=%d max=%d cur=%d\n", policy->min, policy->max, policy->cur); ++ print_info("min=%d max=%d\n", bcm2835_freq_table[0].frequency, bcm2835_freq_table[1].frequency); ++ return cpufreq_generic_init(policy, bcm2835_freq_table, transition_latency); ++} ++ ++/* ++ ===================================================================== ++ Target index function chooses the requested frequency from the table ++ ===================================================================== ++*/ ++ ++static int bcm2835_cpufreq_driver_target_index(struct cpufreq_policy *policy, unsigned int state) ++{ ++ unsigned int target_freq = bcm2835_freq_table[state].frequency; ++ unsigned int cur = bcm2835_cpufreq_set_clock(policy->cur, target_freq); ++ ++ if (!cur) ++ { ++ print_err("Error occurred setting a new frequency (%d)\n", target_freq); ++ return -EINVAL; ++ } ++ print_debug("%s: %i: freq %d->%d\n", policy->governor->name, state, policy->cur, cur); + return 0; +} + +/* -+ ================================================================================= -+ Target function chooses the most appropriate frequency from the table to enable -+ ================================================================================= ++ ====================================================== ++ Get function returns the current frequency from table ++ ====================================================== +*/ + -+static int bcm2835_cpufreq_driver_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) -+{ -+ unsigned int target = target_freq; -+#ifdef CPUFREQ_DEBUG_ENABLE -+ unsigned int cur = policy->cur; -+#endif -+ print_debug("%s: min=%d max=%d cur=%d target=%d\n",policy->governor->name,policy->min,policy->max,policy->cur,target_freq); -+ -+ /* if we are above min and using ondemand, then just use max */ -+ if (strcmp("ondemand", policy->governor->name)==0 && target > policy->min) -+ target = policy->max; -+ /* if the frequency is the same, just quit */ -+ if (target == policy->cur) -+ return 0; -+ -+ /* otherwise were good to set the clock frequency */ -+ policy->cur = bcm2835_cpufreq_set_clock(policy->cur, target); -+ -+ if (!policy->cur) -+ { -+ print_err("Error occurred setting a new frequency (%d)!\n", target); -+ policy->cur = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); -+ return -EINVAL; -+ } -+ print_debug("Freq %d->%d (min=%d max=%d target=%d request=%d)\n", cur, policy->cur, policy->min, policy->max, target_freq, target); -+ return 0; -+} -+ +static unsigned int bcm2835_cpufreq_driver_get(unsigned int cpu) +{ + unsigned int actual_rate = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); -+ print_debug("cpu=%d\n", actual_rate); -+ return actual_rate; ++ print_debug("%d: freq=%d\n", cpu, actual_rate); ++ return actual_rate <= bcm2835_freq_table[0].frequency ? bcm2835_freq_table[0].frequency : bcm2835_freq_table[1].frequency; +} + -+/* -+ ================================================================================= -+ Verify ensures that when a policy is changed, it is suitable for the CPU to use -+ ================================================================================= -+*/ -+ -+static int bcm2835_cpufreq_driver_verify(struct cpufreq_policy *policy) -+{ -+ print_info("switching to governor %s\n", policy->governor->name); -+ return 0; -+} -+ -+ +/* the CPUFreq driver */ +static struct cpufreq_driver bcm2835_cpufreq_driver = { -+ .name = "BCM2835 CPUFreq", -+ .init = bcm2835_cpufreq_driver_init, -+ .verify = bcm2835_cpufreq_driver_verify, -+ .target = bcm2835_cpufreq_driver_target, -+ .get = bcm2835_cpufreq_driver_get ++ .name = "BCM2835 CPUFreq", ++ .init = bcm2835_cpufreq_driver_init, ++ .verify = cpufreq_generic_frequency_table_verify, ++ .target_index = bcm2835_cpufreq_driver_target_index, ++ .get = bcm2835_cpufreq_driver_get, ++ .attr = cpufreq_generic_attr, +}; + +MODULE_AUTHOR("Dorian Peake and Dom Cobley"); @@ -85472,10 +85641,10 @@ index 0000000..7bc55bd +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From 1162e1a02edd5d721f587d5e2afdc51e5013d560 Mon Sep 17 00:00:00 2001 +From dc2fa0b39791d761b713f2f759a648397d03dfee Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 17/82] Added hwmon/thermal driver for reporting core +Subject: [PATCH 17/75] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian --- @@ -85997,10 +86166,10 @@ index 0000000..85fceb5 + +module_platform_driver(bcm2835_thermal_driver); -From 34da3ce697d69b71c68e2af279381a88afe295f2 Mon Sep 17 00:00:00 2001 +From 9dc90bcff14d89bc21651090901814a93e77a91e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 18/82] Allow mac address to be set in smsc95xx +Subject: [PATCH 18/75] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -86091,10 +86260,10 @@ index d07bf4c..5ae60ab 100644 if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -From 2eba886406b0c97b6270d2f34e7ee2589ef28946 Mon Sep 17 00:00:00 2001 +From 0c9a86532c257f5da83904ccaac18861d14857c5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 4 Nov 2013 18:56:10 +0000 -Subject: [PATCH 19/82] Add Chris Boot's i2c and spi drivers. +Subject: [PATCH 19/75] Add Chris Boot's i2c and spi drivers. i2c-bcm2708: fixed baudrate @@ -87440,10 +87609,10 @@ index 0000000..b04a57d +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 0a6f1f3290e53bd26b9177169cb80044f397525f Mon Sep 17 00:00:00 2001 +From d3e15a0761290b2b5b2d6f9083426070931c9f4a Mon Sep 17 00:00:00 2001 From: cbeytas Date: Mon, 24 Jun 2013 00:05:40 -0400 -Subject: [PATCH 20/82] Perform I2C combined transactions when possible +Subject: [PATCH 20/75] Perform I2C combined transactions when possible Perform I2C combined transactions whenever possible, within the restrictions of the Broadcomm Serial Controller. @@ -87515,10 +87684,10 @@ index f266f10..8750634 100644 } -From 48331c6f062108082daddbb9edbcf97678841765 Mon Sep 17 00:00:00 2001 +From cb275aa703826b908fcc8cc8d496d037de04dfcb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 21/82] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 21/75] enabling the realtime clock 1-wire chip DS1307 and 1-wire on GPIO4 (as a module) 1-wire: Add support for configuring pin for w1-gpio kernel module @@ -87790,17 +87959,17 @@ index 2820924..fd0550f 100644 } } -From 89f17effaf34de81af1918f01df5d7b756c21109 Mon Sep 17 00:00:00 2001 +From 6054952c7bfec769bec49b57ff6041383061637f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 12 Apr 2013 23:58:47 +0100 -Subject: [PATCH 23/82] config: add missing options from 3.6.y kernel +Subject: [PATCH 23/75] config: add missing options from 3.6.y kernel --- - arch/arm/configs/bcmrpi_defconfig | 629 ++++++++++++++++++++++++++++++++++++-- - 1 file changed, 610 insertions(+), 19 deletions(-) + arch/arm/configs/bcmrpi_defconfig | 636 ++++++++++++++++++++++++++++++++++++-- + 1 file changed, 617 insertions(+), 19 deletions(-) diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 6d2eae1..ae787a6 100644 +index 6d2eae1..218df4b 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -1,3 +1,5 @@ @@ -88273,7 +88442,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_RTL8192CU=m CONFIG_ZD1211RW=m CONFIG_MWIFIEX=m -@@ -174,6 +499,11 @@ CONFIG_INPUT_JOYDEV=m +@@ -174,6 +499,13 @@ CONFIG_INPUT_JOYDEV=m CONFIG_INPUT_EVDEV=m # CONFIG_INPUT_KEYBOARD is not set # CONFIG_INPUT_MOUSE is not set @@ -88282,10 +88451,12 @@ index 6d2eae1..ae787a6 100644 +CONFIG_JOYSTICK_IFORCE_USB=y +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y ++CONFIG_INPUT_TOUCHSCREEN=y ++CONFIG_TOUCHSCREEN_ADS7846=m CONFIG_INPUT_MISC=y CONFIG_INPUT_AD714X=m CONFIG_INPUT_ATI_REMOTE2=m -@@ -189,22 +519,190 @@ CONFIG_SERIO_RAW=m +@@ -189,22 +521,195 @@ CONFIG_SERIO_RAW=m CONFIG_GAMEPORT=m CONFIG_GAMEPORT_NS558=m CONFIG_GAMEPORT_L4=m @@ -88358,6 +88529,7 @@ index 6d2eae1..ae787a6 100644 +CONFIG_USB_GSPCA_BENQ=m +CONFIG_USB_GSPCA_CONEX=m +CONFIG_USB_GSPCA_CPIA1=m ++CONFIG_USB_GSPCA_DTCS033=m +CONFIG_USB_GSPCA_ETOMS=m +CONFIG_USB_GSPCA_FINEPIX=m +CONFIG_USB_GSPCA_JEILINJ=m @@ -88389,6 +88561,7 @@ index 6d2eae1..ae787a6 100644 +CONFIG_USB_GSPCA_SQ905C=m +CONFIG_USB_GSPCA_SQ930X=m +CONFIG_USB_GSPCA_STK014=m ++CONFIG_USB_GSPCA_STK1135=m +CONFIG_USB_GSPCA_STV0680=m +CONFIG_USB_GSPCA_SUNPLUS=m +CONFIG_USB_GSPCA_T613=m @@ -88403,10 +88576,13 @@ index 6d2eae1..ae787a6 100644 +CONFIG_USB_ZR364XX=m +CONFIG_USB_STKWEBCAM=m +CONFIG_USB_S2255=m ++CONFIG_VIDEO_USBTV=m +CONFIG_VIDEO_PVRUSB2=m +CONFIG_VIDEO_HDPVR=m +CONFIG_VIDEO_TLG2300=m +CONFIG_VIDEO_USBVISION=m ++CONFIG_VIDEO_STK1160_COMMON=m ++CONFIG_VIDEO_GO7007=m +CONFIG_VIDEO_AU0828=m +CONFIG_VIDEO_CX231XX=m +CONFIG_VIDEO_CX231XX_ALSA=m @@ -88478,7 +88654,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set -@@ -227,8 +725,10 @@ CONFIG_SND_BCM2835=m +@@ -227,8 +732,10 @@ CONFIG_SND_BCM2835=m CONFIG_SND_USB_AUDIO=m CONFIG_SND_USB_UA101=m CONFIG_SND_USB_CAIAQ=m @@ -88489,7 +88665,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_HID_A4TECH=m CONFIG_HID_ACRUX=m CONFIG_HID_APPLE=m -@@ -267,9 +767,11 @@ CONFIG_HID_SUNPLUS=m +@@ -267,9 +774,11 @@ CONFIG_HID_SUNPLUS=m CONFIG_HID_GREENASIA=m CONFIG_HID_SMARTJOYPLUS=m CONFIG_HID_TOPSEED=m @@ -88501,7 +88677,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_HID_ZEROPLUS=m CONFIG_HID_ZYDACRON=m CONFIG_HID_PID=y -@@ -277,6 +779,8 @@ CONFIG_USB_HIDDEV=y +@@ -277,6 +786,8 @@ CONFIG_USB_HIDDEV=y CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_MON=m @@ -88510,7 +88686,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m CONFIG_USB_STORAGE_DATAFAB=m -@@ -311,6 +815,7 @@ CONFIG_USB_SERIAL_IPAQ=m +@@ -311,6 +822,7 @@ CONFIG_USB_SERIAL_IPAQ=m CONFIG_USB_SERIAL_IR=m CONFIG_USB_SERIAL_EDGEPORT=m CONFIG_USB_SERIAL_EDGEPORT_TI=m @@ -88518,7 +88694,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_USB_SERIAL_GARMIN=m CONFIG_USB_SERIAL_IPW=m CONFIG_USB_SERIAL_IUU=m -@@ -319,6 +824,7 @@ CONFIG_USB_SERIAL_KEYSPAN=m +@@ -319,6 +831,7 @@ CONFIG_USB_SERIAL_KEYSPAN=m CONFIG_USB_SERIAL_KLSI=m CONFIG_USB_SERIAL_KOBIL_SCT=m CONFIG_USB_SERIAL_MCT_U232=m @@ -88526,7 +88702,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_USB_SERIAL_MOS7720=m CONFIG_USB_SERIAL_MOS7840=m CONFIG_USB_SERIAL_NAVMAN=m -@@ -336,7 +842,11 @@ CONFIG_USB_SERIAL_XIRCOM=m +@@ -336,7 +849,11 @@ CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OPTION=m CONFIG_USB_SERIAL_OMNINET=m CONFIG_USB_SERIAL_OPTICON=m @@ -88538,7 +88714,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_USB_SERIAL_DEBUG=m CONFIG_USB_EMI62=m CONFIG_USB_EMI26=m -@@ -357,11 +867,76 @@ CONFIG_USB_IOWARRIOR=m +@@ -357,11 +874,76 @@ CONFIG_USB_IOWARRIOR=m CONFIG_USB_TEST=m CONFIG_USB_ISIGHTFW=m CONFIG_USB_YUREX=m @@ -88615,7 +88791,7 @@ index 6d2eae1..ae787a6 100644 # CONFIG_IOMMU_SUPPORT is not set CONFIG_EXT4_FS=y CONFIG_EXT4_FS_POSIX_ACL=y -@@ -384,6 +959,8 @@ CONFIG_BTRFS_FS=m +@@ -384,6 +966,8 @@ CONFIG_BTRFS_FS=m CONFIG_BTRFS_FS_POSIX_ACL=y CONFIG_NILFS2_FS=m CONFIG_FANOTIFY=y @@ -88624,7 +88800,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_AUTOFS4_FS=y CONFIG_FUSE_FS=m CONFIG_CUSE=m -@@ -399,18 +976,26 @@ CONFIG_MSDOS_FS=y +@@ -399,18 +983,26 @@ CONFIG_MSDOS_FS=y CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_IOCHARSET="ascii" CONFIG_NTFS_FS=m @@ -88651,7 +88827,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_CIFS=m CONFIG_CIFS_WEAK_PW_HASH=y CONFIG_CIFS_XATTR=y -@@ -455,7 +1040,7 @@ CONFIG_NLS_ISO8859_14=m +@@ -455,7 +1047,7 @@ CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m @@ -88660,7 +88836,7 @@ index 6d2eae1..ae787a6 100644 CONFIG_PRINTK_TIME=y CONFIG_BOOT_PRINTK_DELAY=y CONFIG_DEBUG_INFO=y -@@ -463,28 +1048,34 @@ CONFIG_DEBUG_STACK_USAGE=y +@@ -463,28 +1055,34 @@ CONFIG_DEBUG_STACK_USAGE=y CONFIG_DEBUG_MEMORY_INIT=y CONFIG_DETECT_HUNG_TASK=y CONFIG_TIMER_STATS=y @@ -88699,10 +88875,10 @@ index 6d2eae1..ae787a6 100644 # CONFIG_CRYPTO_HW is not set CONFIG_CRC_ITU_T=y -From 2d11277534ec321bb9707b54a45098891fca635a Mon Sep 17 00:00:00 2001 +From 7e735bc2e7eff49c6c007f6e91f9cee3d09022fd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 24/82] config: Enable CONFIG_MEMCG, but leave it disabled (due +Subject: [PATCH 24/75] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -88712,7 +88888,7 @@ Subject: [PATCH 24/82] config: Enable CONFIG_MEMCG, but leave it disabled (due 3 files changed, 25 insertions(+) diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index ae787a6..6ce900c 100644 +index 218df4b..39ae974 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -19,6 +19,7 @@ CONFIG_CGROUP_FREEZER=y @@ -88770,10 +88946,10 @@ index 28928ce..33d37c3 100644 #ifdef CONFIG_MEMCG_SWAP -From 1fefc19d8c277b0612c8ba710c4d79916d4b4853 Mon Sep 17 00:00:00 2001 +From 463c38f5b1c2de102b21b295a6aa8112a743e4a9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:46:42 +0100 -Subject: [PATCH 25/82] Add FIQ patch to dwc_otg driver. Enable with +Subject: [PATCH 25/75] Add FIQ patch to dwc_otg driver. Enable with dwc_otg.fiq_fix_enable=1. Should give about 10% more ARM performance. Thanks to Gordon and Costas @@ -92069,10 +92245,10 @@ index 1b1f83c..c8590b5 100644 if (status.b.sr) { -From 918d8d80064d99000e52a25b77efacf5337f6a57 Mon Sep 17 00:00:00 2001 +From 5379571170c2c633918e07010b39205f7808b71c Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 19 Mar 2014 12:58:23 +0000 -Subject: [PATCH 26/82] dwc_otg: fiq_fsm: Base commit for driver rewrite +Subject: [PATCH 26/75] dwc_otg: fiq_fsm: Base commit for driver rewrite This commit removes the previous FIQ fixes entirely and adds fiq_fsm. @@ -96968,10 +97144,10 @@ index 5d310df..4b32941 100644 return -EBUSY; } -From e38fd6510256d509c5487925bb29ba8940ce0d76 Mon Sep 17 00:00:00 2001 +From e501f0ecc235a17016fbdf298d62d1cd1f9cb3a5 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 27/82] bcm2835: add v4l2 camera device +Subject: [PATCH 27/75] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -102954,10 +103130,10 @@ index 0000000..9d1d11e + +#endif /* MMAL_VCHIQ_H */ -From 3fecd7e096c3e2d8fae870e4aa42547fb30a7a4b Mon Sep 17 00:00:00 2001 +From 7a138d678b9c78fb31066c4d92c4f6d1660620f7 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 9 Dec 2013 10:58:01 +0000 -Subject: [PATCH 28/82] V4L2: Fixes from 6by9 +Subject: [PATCH 28/75] V4L2: Fixes from 6by9 V4L2: Fix EV values. Add manual shutter speed control @@ -103187,10 +103363,10 @@ Signed-off-by: Dave Stevenson 8 files changed, 1292 insertions(+), 178 deletions(-) diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 6ce900c..d77317c 100644 +index 39ae974..d2f5620 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -686,6 +686,9 @@ CONFIG_DVB_B2C2_FLEXCOP_USB=m +@@ -693,6 +693,9 @@ CONFIG_DVB_B2C2_FLEXCOP_USB=m CONFIG_VIDEO_EM28XX=m CONFIG_VIDEO_EM28XX_ALSA=m CONFIG_VIDEO_EM28XX_DVB=m @@ -105329,10 +105505,10 @@ index a06fb44..76f249e 100644 release_msg: -From a61195e6feea9ca5929e46e5820b49d1e10272e5 Mon Sep 17 00:00:00 2001 +From b49f9bd29aaa9dcaf84bbab8f18c4f3cff9abf46 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 29/82] dmaengine: Add support for BCM2708 +Subject: [PATCH 29/75] dmaengine: Add support for BCM2708 Add support for DMA controller of BCM2708 as used in the Raspberry Pi. Currently it only supports cyclic DMA. @@ -106458,10 +106634,10 @@ index 0000000..6766799 +MODULE_AUTHOR("Gellert Weisz "); +MODULE_LICENSE("GPL v2"); -From d6c86289d22b49d6ff94876c4797e506189e358d Mon Sep 17 00:00:00 2001 +From 6ec75f9b99b74595905a16b7e1c71e5b607fc309 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 30/82] ASoC: Add support for BCM2708 +Subject: [PATCH 30/75] ASoC: Add support for BCM2708 This driver adds support for digital audio (I2S) for the BCM2708 SoC that is used by the @@ -107456,10 +107632,10 @@ index 0000000..ebaf3d6 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 8ed750f6a8efc0038dabef1b4e75064d27e98495 Mon Sep 17 00:00:00 2001 +From 9847de888207ff72d48e651e365d09c6a2a9b731 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 31/82] ASoC: Add support for PCM5102A codec +Subject: [PATCH 31/75] ASoC: Add support for PCM5102A codec Some definitions to support the PCM5102A codec by Texas Instruments. @@ -107584,10 +107760,10 @@ index 0000000..126f1e9 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From ba6776792cfab454c1da7f2e0521993a2a74c76c Mon Sep 17 00:00:00 2001 +From cb41b6a7f3d4ff67916c0bf5055d282a65e32696 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 32/82] BCM2708: Add I2S support to board file +Subject: [PATCH 32/75] BCM2708: Add I2S support to board file Adds the required initializations for I2S to the board file of mach-bcm2708. @@ -107642,10 +107818,10 @@ index a740344..dca28ad 100644 struct amba_device *d = amba_devs[i]; amba_device_register(d, &iomem_resource); -From 3356823e1106386979002a7b3aba4f07bf03d4cf Mon Sep 17 00:00:00 2001 +From 751a064c164e5204bfca2dcbda358d9b052908f9 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 33/82] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 33/75] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -107794,10 +107970,10 @@ index 0000000..4b70b45 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 8513da82d5ec4283e05f25d4a481f840179ffccc Mon Sep 17 00:00:00 2001 +From ae60560fa53670d563c8ea0d7baaa40e6d16a728 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 34/82] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 34/75] BCM2708: Add HifiBerry DAC to board file This adds the initalization of the HifiBerry DAC to the mach-bcm2708 board file. @@ -107845,10 +108021,10 @@ index dca28ad..50d4991 100644 struct amba_device *d = amba_devs[i]; amba_device_register(d, &iomem_resource); -From 7b6218d551bf4b7e84e9b73eaed83bc3bb136080 Mon Sep 17 00:00:00 2001 +From 5ae24980878b0c244ffd2fd5c38ba6811e15a909 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 18:55:53 +0100 -Subject: [PATCH 35/82] ASoC: BCM2708: Add 24 bit support +Subject: [PATCH 35/75] ASoC: BCM2708: Add 24 bit support This adds 24 bit support to the I2S driver of the BCM2708. Besides enabling the 24 bit flags, it includes two bug fixes: @@ -107920,10 +108096,10 @@ index ebaf3d6..a179216 100644 .period_bytes_min = 32, .period_bytes_max = 64 * PAGE_SIZE, -From 0122f7477ee81be5ca768904bb6c23570f956504 Mon Sep 17 00:00:00 2001 +From 8755358db94d7aab05018e0ab5750b70daeb5dd8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Sep 2014 10:52:04 +0100 -Subject: [PATCH 36/82] bcm2708-i2s: Update bclk_ratio to more correct values +Subject: [PATCH 36/75] bcm2708-i2s: Update bclk_ratio to more correct values --- sound/soc/bcm/bcm2708-i2s.c | 6 +++--- @@ -107953,10 +108129,10 @@ index a179216..fd50e2d 100644 default: return -EINVAL; -From 58cff69a0e46077a6ac3cfa0dba80f4ec8d9a685 Mon Sep 17 00:00:00 2001 +From e1a57967a2243546c9e48d9f7e144ea2d55ca927 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 2 Dec 2013 20:28:22 +0100 -Subject: [PATCH 37/82] BCM2708: Add I2S and DMA support to default config +Subject: [PATCH 37/75] BCM2708: Add I2S and DMA support to default config This commit adds several modules that are needed for I2S support for the Raspberry Pi to the defconfig. @@ -107967,10 +108143,10 @@ Signed-off-by: Florian Meier 1 file changed, 6 insertions(+) diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index d77317c..4fb22fc 100644 +index d2f5620..e786ca8 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -731,6 +731,10 @@ CONFIG_SND_USB_UA101=m +@@ -738,6 +738,10 @@ CONFIG_SND_USB_UA101=m CONFIG_SND_USB_CAIAQ=m CONFIG_SND_USB_CAIAQ_INPUT=y CONFIG_SND_USB_6FIRE=m @@ -107981,7 +108157,7 @@ index d77317c..4fb22fc 100644 CONFIG_SOUND_PRIME=m CONFIG_HIDRAW=y CONFIG_HID_A4TECH=m -@@ -925,6 +929,8 @@ CONFIG_RTC_DRV_RS5C348=m +@@ -932,6 +936,8 @@ CONFIG_RTC_DRV_RS5C348=m CONFIG_RTC_DRV_DS3234=m CONFIG_RTC_DRV_PCF2123=m CONFIG_RTC_DRV_RX4581=m @@ -107991,10 +108167,10 @@ index d77317c..4fb22fc 100644 CONFIG_UIO_PDRV_GENIRQ=m CONFIG_STAGING=y -From 01322b6bd87f4dfad730f8ae59c380f9539d2666 Mon Sep 17 00:00:00 2001 +From 5353c51962620e0bca93296e1661cbb4fc784de1 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 38/82] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 38/75] ASoC: BCM2708: Add support for RPi-DAC This adds a machine driver for the RPi-DAC. @@ -108013,10 +108189,10 @@ Signed-off-by: Florian Meier create mode 100644 sound/soc/codecs/pcm1794a.c diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 4fb22fc..5f402ac 100644 +index e786ca8..64bd592 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -734,6 +734,7 @@ CONFIG_SND_USB_6FIRE=m +@@ -741,6 +741,7 @@ CONFIG_SND_USB_6FIRE=m CONFIG_SND_SOC=m CONFIG_SND_BCM2708_SOC_I2S=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m @@ -108302,10 +108478,10 @@ index 0000000..b4eaa44 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 7a1d5a33253ab9b4eabed87df78c2fcd116b38c9 Mon Sep 17 00:00:00 2001 +From caea0e1e9c1fd311b25d8acfadcd34f97f36efe8 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 39/82] ASoC: wm8804: Implement MCLK configuration options, add +Subject: [PATCH 39/75] ASoC: wm8804: Implement MCLK configuration options, add 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs for most sample rates. At 192kHz only 128xfs is supported. The existing driver selects 128xfs automatically for some lower samples rates. By using an @@ -108345,10 +108521,10 @@ index 0ea01df..4724553 100644 #define WM8804_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \ -From 544fbd99d8a1351a98f7264d62daf1020f0a1ad0 Mon Sep 17 00:00:00 2001 +From c2ba324fd1e68647e5caea1d0b3a968280239c99 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 40/82] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 40/75] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -108551,10 +108727,10 @@ index 0000000..e4f769d +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 0010956551eab2ce3f82ba83c5d67172460ce3f6 Mon Sep 17 00:00:00 2001 +From 3033e4d8f6465f11ad844c4b7f6695e4b94ddc0f Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 41/82] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 41/75] BCM2708: Added support for HiFiBerry Digi board Board initalization by I2C Signed-off-by: Daniel Matuschek @@ -108601,10 +108777,10 @@ index 100c223..a57cb85 100644 bcm_register_device(&snd_rpi_dac_device); bcm_register_device(&snd_pcm1794a_codec_device); -From a2d24d68441d60519bfce05150edbdf70db96160 Mon Sep 17 00:00:00 2001 +From f2f5568f97bf8b243793012fb55136f7d2cd76fd Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:27:28 +0100 -Subject: [PATCH 42/82] BCM2708: Added HiFiBerry Digi configuration option It +Subject: [PATCH 42/75] BCM2708: Added HiFiBerry Digi configuration option It will be compiled as a module by default. This also includes the WM8804 driver. @@ -108614,10 +108790,10 @@ Signed-off-by: Daniel Matuschek 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 5f402ac..070ee49 100644 +index 64bd592..10b4c9e 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -734,6 +734,7 @@ CONFIG_SND_USB_6FIRE=m +@@ -741,6 +741,7 @@ CONFIG_SND_USB_6FIRE=m CONFIG_SND_SOC=m CONFIG_SND_BCM2708_SOC_I2S=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m @@ -108626,10 +108802,10 @@ index 5f402ac..070ee49 100644 CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m -From 0bfe07a263797f9a04fcf728d2d7d9c2c03b486e Mon Sep 17 00:00:00 2001 +From e08ad0555d056b2419f2a8feecae07ff7281bc48 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 43/82] ASoC: wm8804: Set idle_bias_off to false Idle bias has +Subject: [PATCH 43/75] ASoC: wm8804: Set idle_bias_off to false Idle bias has been change to remove warning on driver startup Signed-off-by: Daniel Matuschek @@ -108651,10 +108827,10 @@ index 4724553..5d4140e 100644 .controls = wm8804_snd_controls, .num_controls = ARRAY_SIZE(wm8804_snd_controls), -From ac1dd319acaae07171260b1b1e741000ce6cf8d9 Mon Sep 17 00:00:00 2001 +From c4b4145cb9859846bf8fea91ecb2ffb228ed5036 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 44/82] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 44/75] Add IQaudIO Sound Card support for Raspberry Pi --- arch/arm/configs/bcmrpi_defconfig | 1 + @@ -108666,10 +108842,10 @@ Subject: [PATCH 44/82] Add IQaudIO Sound Card support for Raspberry Pi create mode 100644 sound/soc/bcm/iqaudio-dac.c diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 070ee49..db259ae 100644 +index 10b4c9e..0512e82 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -736,6 +736,7 @@ CONFIG_SND_BCM2708_SOC_I2S=m +@@ -743,6 +743,7 @@ CONFIG_SND_BCM2708_SOC_I2S=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m CONFIG_SND_BCM2708_SOC_RPI_DAC=m @@ -108864,10 +109040,10 @@ index 0000000..8d0e2ae +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From dbda0b55f5024ce83050bfbbd872fb7d77925f64 Mon Sep 17 00:00:00 2001 +From 9a57926cc15ae20bde6a8705f865343ca08b711a Mon Sep 17 00:00:00 2001 From: Howard Mitchell Date: Wed, 30 Jul 2014 21:43:37 +0100 -Subject: [PATCH 45/82] soc-core: Fix volsw_range funcs so +Subject: [PATCH 45/75] soc-core: Fix volsw_range funcs so SOC_DOUBLE_R_RANGE_TLV works. This is so that the correct range of values as specified @@ -108941,10 +109117,10 @@ index d074aa9..3d5fefd 100644 return 0; -From 07f408267f733baf3b580c87f00dc1500a1f2132 Mon Sep 17 00:00:00 2001 +From 40300ddeada34fcb7cb2ea90f79c1ff00e88f3a4 Mon Sep 17 00:00:00 2001 From: Howard Mitchell Date: Fri, 28 Mar 2014 16:40:31 +0000 -Subject: [PATCH 46/82] pcm512x: Use a range macro for Volume and rename to +Subject: [PATCH 46/75] pcm512x: Use a range macro for Volume and rename to PCM. This allows limiting the output gain to avoid clipping in the @@ -108969,10 +109145,10 @@ index 0c8aefa..8252e6d 100644 PCM512x_LAGN_SHIFT, PCM512x_RAGN_SHIFT, 1, 1, analog_tlv), SOC_DOUBLE_TLV("Playback Boost Volume", PCM512x_ANALOG_GAIN_BOOST, -From 1c5a6fdc9411601c9c5772812377f3ae44a837e8 Mon Sep 17 00:00:00 2001 +From 43cc448efd24ea1e35c553dbf2e1294b33553c90 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Fri, 2 May 2014 16:13:59 +0100 -Subject: [PATCH 47/82] Move GPIO setup to hw_params. +Subject: [PATCH 47/75] Move GPIO setup to hw_params. This is used to stop the I2S driver from breaking the GPIO setup for other uses of the PCM interface @@ -109068,10 +109244,10 @@ index fd50e2d..0c20d4d 100644 dev->clk_regmap = regmap[1]; -From ab018fb7d84e887607a1953cfd293ea7d411e90f Mon Sep 17 00:00:00 2001 +From 3701ea464c7e77402a458d71f5e74c196addc9fa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 48/82] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 48/75] vmstat: Workaround for issue where dirty page count goes negative See: @@ -109098,10 +109274,10 @@ index 82e7db7..f87d16d 100644 static inline void __inc_zone_page_state(struct page *page, -From 79cb93bd5d38be118bdf9a54dbfdf1c5f02e54d6 Mon Sep 17 00:00:00 2001 +From 16d5c3833f0623fdf338bab45ea23d8c0aaf390f Mon Sep 17 00:00:00 2001 From: P33M Date: Fri, 20 Jun 2014 16:03:12 +0100 -Subject: [PATCH 49/82] dwc_otg: Fix various issues with root port and +Subject: [PATCH 49/75] dwc_otg: Fix various issues with root port and transaction errors Process the host port interrupts correctly (and don't trample them). @@ -109171,10 +109347,10 @@ index d3e2035..6182d3e 100644 fiq_print(FIQDBG_ERR, dwc_otg_hcd->fiq_state, "RESET "); } -From 16557844a1b480d65a7e66308a0b81e8c3f96506 Mon Sep 17 00:00:00 2001 +From 45a1e9213f55810e7f28495ea7681b16c701cd7f Mon Sep 17 00:00:00 2001 From: P33M Date: Fri, 20 Jun 2014 17:23:20 +0100 -Subject: [PATCH 50/82] fiq_fsm: Implement hack for Split Interrupt +Subject: [PATCH 50/75] fiq_fsm: Implement hack for Split Interrupt transactions Hubs aren't too picky about which endpoint we send Control type split @@ -109260,10 +109436,10 @@ index ebc3553..c39ef31 100644 break; } -From 5adf83fe8754c3f75e71334689816411f4e61e20 Mon Sep 17 00:00:00 2001 +From 7e39cf722f973300bf329d98e6c592a2627040a6 Mon Sep 17 00:00:00 2001 From: notro Date: Sun, 6 Jul 2014 12:07:25 +0200 -Subject: [PATCH 51/82] spi-bcm2708: Prepare for Common Clock Framework +Subject: [PATCH 51/75] spi-bcm2708: Prepare for Common Clock Framework migration As part of migrating to use the Common Clock Framework, replace clk_enable() @@ -109308,10 +109484,10 @@ index b04a57d..349d21f 100644 free_irq(bs->irq, master); iounmap(bs->base); -From 4ec46a65f299aed7ce5360cfa5dee1153af6120c Mon Sep 17 00:00:00 2001 +From 6a76ad000c90713f38990f8dfe1ac30c38e81940 Mon Sep 17 00:00:00 2001 From: notro Date: Sun, 6 Jul 2014 12:09:30 +0200 -Subject: [PATCH 52/82] BCM2708: Migrate to the Common Clock Framework +Subject: [PATCH 52/75] BCM2708: Migrate to the Common Clock Framework As part of moving towards using Device Tree, the Common Clock Framework has to be used instead of the BCM2708 clock implementation. @@ -109581,10 +109757,10 @@ index 5f9d725..0000000 - unsigned long rate; -}; -From 9d238e8eab9bd67713b04ce5c6979ed7a98f62d8 Mon Sep 17 00:00:00 2001 +From 4cbe9f41d471c03ea832e378de3ff95ed655f6e2 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 53/82] BCM2708: Add core Device Tree support +Subject: [PATCH 53/75] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. @@ -109741,10 +109917,10 @@ index ef12cb8..747e27a 100644 module_param(boardrev, uint, 0644); -From 12e35a04c0d6c8cf052f890471fd5ca8508214fc Mon Sep 17 00:00:00 2001 +From 69c14f012a5259870807a693274231eb5b20c3f9 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:47:48 +0200 -Subject: [PATCH 54/82] BCM2708: armctrl: Add IRQ Device Tree support +Subject: [PATCH 54/75] BCM2708: armctrl: Add IRQ Device Tree support Add Device Tree IRQ support for BCM2708. Usage is the same as for irq-bcm2835. @@ -109908,10 +110084,10 @@ index d4c5333..42f5e1c 100644 return 0; } -From c8f19659618ef44a8c8451aa2949a0de39fe4262 Mon Sep 17 00:00:00 2001 +From 66da1b474c25bc980370b7ff80c9b7f764d72af5 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 55/82] pinctrl: add bcm2708 driver +Subject: [PATCH 55/75] pinctrl: add bcm2708 driver This driver is a verbatim copy of the pinctrl-bcm2835 driver, except for: * changed 2835 to 2708 @@ -110774,10 +110950,10 @@ index 0000000..40d9c86 +MODULE_DESCRIPTION("BCM2708 Pin control driver"); +MODULE_LICENSE("GPL"); -From 72c98df333121827570f09791f5c4b5abcc6e577 Mon Sep 17 00:00:00 2001 +From 37798c64b1dd12aca2ee680654d112945d863aa5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 56/82] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 56/75] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -110813,10 +110989,10 @@ index 79cf503..db5ebe7 100644 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From 62253dc0f499215fcc78175b6c56abc68c082078 Mon Sep 17 00:00:00 2001 +From 151b08e3c509e6fd47e693442fd3b9d5c2be864d Mon Sep 17 00:00:00 2001 From: notro Date: Fri, 18 Jul 2014 18:15:57 +0200 -Subject: [PATCH 57/82] BCM2708: DT: change 'axi' nodename to 'soc' +Subject: [PATCH 57/75] BCM2708: DT: change 'axi' nodename to 'soc' Change DT node named 'axi' to 'soc' so it matches ARCH_BCM2835. The VC4 bootloader fills in certain properties in the 'axi' subtree, @@ -110841,10 +111017,10 @@ index 3f884b3..e02e67b 100644 #address-cells = <1>; #size-cells = <1>; -From df1dfe707af557bed838c72368580d3ae38d7781 Mon Sep 17 00:00:00 2001 +From fc6e7f966338c90d72226d6d088f2079707c541b Mon Sep 17 00:00:00 2001 From: notro Date: Sun, 27 Jul 2014 20:12:58 +0200 -Subject: [PATCH 58/82] spi: bcm2708: add device tree support +Subject: [PATCH 58/75] spi: bcm2708: add device tree support Add DT support to driver and add to .dtsi file. Setup pins and spidev in .dts file. @@ -110963,10 +111139,10 @@ index 349d21f..041b5e2 100644 .probe = bcm2708_spi_probe, .remove = bcm2708_spi_remove, -From ae499db61586a7362ecb7a53bf83e71d82b7fbdf Mon Sep 17 00:00:00 2001 +From 1df7ab12a1edb639d755f5e65a081343c25d9aa8 Mon Sep 17 00:00:00 2001 From: notro Date: Sun, 27 Jul 2014 20:13:44 +0200 -Subject: [PATCH 59/82] BCM2708: don't register SPI controller when using DT +Subject: [PATCH 59/75] BCM2708: don't register SPI controller when using DT The device for the SPI controller is in the Device Tree. Only register the device when not using DT. @@ -111037,10 +111213,10 @@ index 747e27a..0434cbf 100644 bcm_register_device(&bcm2708_bsc1_device); -From 3a48251da38791c8fbd3db6d5deccee869c2edf8 Mon Sep 17 00:00:00 2001 +From b70599e0aa4493e8a7d535a2d5f6c3ab964d345c Mon Sep 17 00:00:00 2001 From: notro Date: Sun, 27 Jul 2014 20:14:05 +0200 -Subject: [PATCH 60/82] spi: bcm2835: make driver available on ARCH_BCM2708 +Subject: [PATCH 60/75] spi: bcm2835: make driver available on ARCH_BCM2708 Make this driver available on ARCH_BCM2708 @@ -111063,10 +111239,10 @@ index 6a7943c..6600723 100644 This selects a driver for the Broadcom BCM2835 SPI master. -From 4512e24fd6757653c0eb4311ca56c1d63396da5d Mon Sep 17 00:00:00 2001 +From 9ec05163cca97a48696c89ab3968407b0518c695 Mon Sep 17 00:00:00 2001 From: notro Date: Tue, 29 Jul 2014 11:04:49 +0200 -Subject: [PATCH 61/82] i2c: bcm2708: add device tree support +Subject: [PATCH 61/75] i2c: bcm2708: add device tree support Add DT support to driver and add to .dtsi file. Setup pins in .dts file. @@ -111231,10 +111407,10 @@ index 8750634..728cb69 100644 .probe = bcm2708_i2c_probe, .remove = bcm2708_i2c_remove, -From 87ca98a34f4ca7f95f8a9ff0a3770aab096f16cb Mon Sep 17 00:00:00 2001 +From ace20f88fa868a6e5ee39e6d6956f698e3d8ae60 Mon Sep 17 00:00:00 2001 From: notro Date: Tue, 29 Jul 2014 11:05:18 +0200 -Subject: [PATCH 62/82] bcm2708: don't register i2c controllers when using DT +Subject: [PATCH 62/75] bcm2708: don't register i2c controllers when using DT The devices for the i2c controllers are in the Device Tree. Only register devices when not using DT. @@ -111276,10 +111452,10 @@ index 0434cbf..902f8c7 100644 bcm_register_device(&bcm2835_hwmon_device); bcm_register_device(&bcm2835_thermal_device); -From d3953edb6932ecf0e738e8fd0b169c144ed79b6e Mon Sep 17 00:00:00 2001 +From e999971cc827a0beb0b0964ce8451fa463cbfba5 Mon Sep 17 00:00:00 2001 From: notro Date: Tue, 29 Jul 2014 11:05:39 +0200 -Subject: [PATCH 63/82] i2c: bcm2835: make driver available on ARCH_BCM2708 +Subject: [PATCH 63/75] i2c: bcm2835: make driver available on ARCH_BCM2708 Make this driver available on ARCH_BCM2708 @@ -111302,10 +111478,10 @@ index d8f8e2a..5f62d88 100644 If you say yes to this option, support will be included for the BCM2835 I2C controller. -From a4eb1378588a26b20fb9f43934005e42be5a1ffe Mon Sep 17 00:00:00 2001 +From b2b405b7b3958073edea93c9d4aa4c067437eb02 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Fri, 25 Jul 2014 07:08:09 +0200 -Subject: [PATCH 64/82] Configure GPIOs for I2S based on revision/card settings +Subject: [PATCH 64/75] Configure GPIOs for I2S based on revision/card settings With RPi model B+, assignment of the I2S GPIO pins has changed. This patch uses the board revision to auto-detect the GPIOs used @@ -111490,10 +111666,10 @@ index 0000000..94fed6a + +#endif -From 6d36ce61af48e3985386d55689b45909ba13ab43 Mon Sep 17 00:00:00 2001 +From a11534d2cbd42db090e90455fa5c59ffe6b1a34a Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 24 Jul 2014 21:24:03 +0100 -Subject: [PATCH 65/82] usb: core: make overcurrent messages more prominent +Subject: [PATCH 65/75] usb: core: make overcurrent messages more prominent Hub overcurrent messages are more serious than "debug". Increase loglevel. --- @@ -111514,10 +111690,10 @@ index dc84915..e9e061e 100644 USB_PORT_FEAT_C_OVER_CURRENT); msleep(100); /* Cool down */ -From b284b3f967a974ca6af7fb5088d7b4f0808578e5 Mon Sep 17 00:00:00 2001 +From 93707531cf7dda3b28df2a4f59346dba9f4bbe08 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 66/82] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 66/75] vcsm: VideoCore shared memory service for BCM2835 Add experimental support for the VideoCore shared memory service. This allows user processes to allocate memory from VideoCore's @@ -115850,10 +116026,10 @@ index 0000000..da1c523 +MODULE_DESCRIPTION("VideoCore SharedMemory Driver"); +MODULE_LICENSE("GPL v2"); -From 83850fd7d44d21476e23ca70b73402bf88c5204a Mon Sep 17 00:00:00 2001 +From bd03f6beca0236e6309cdae720b276bebe174afb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 Aug 2014 02:03:50 +0100 -Subject: [PATCH 67/82] Revert "ARM: dma: Use dma_pfn_offset for dma address +Subject: [PATCH 67/75] Revert "ARM: dma: Use dma_pfn_offset for dma address translation" This reverts commit 6ce0d20016925d031f1e24d64302e4c976d7cec6. @@ -115905,10 +116081,10 @@ index c45b61a..0af6bd0 100644 } -From 6c1e4792016e0bb0d1712fb120154c32eabb17b4 Mon Sep 17 00:00:00 2001 +From e2b2d65ff4d36109f52d05ac956b48958c4ada5c Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 68/82] MMC: added alternative MMC driver +Subject: [PATCH 68/75] MMC: added alternative MMC driver --- arch/arm/configs/bcmrpi_defconfig | 2 + @@ -115920,10 +116096,10 @@ Subject: [PATCH 68/82] MMC: added alternative MMC driver create mode 100644 drivers/mmc/host/bcm2835-mmc.c diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index db259ae..f88d2d6 100644 +index 0512e82..1bee9b5 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -887,6 +887,8 @@ CONFIG_MMC=y +@@ -894,6 +894,8 @@ CONFIG_MMC=y CONFIG_MMC_BLOCK_MINORS=32 CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_PLTFM=y @@ -117605,10 +117781,10 @@ index 0000000..123ff94 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From e5a1e8951507bd8708d239a6f7c0ba1a31d7573c Mon Sep 17 00:00:00 2001 +From d26f91f57854f6b4596bab562378abbf20970a39 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 69/82] Added support for HiFiBerry DAC+ +Subject: [PATCH 69/75] Added support for HiFiBerry DAC+ The driver is based on the HiFiBerry DAC driver. However HiFiBerry DAC+ uses a different codec chip (PCM5122), therefore a new driver is necessary. @@ -117622,10 +117798,10 @@ a different codec chip (PCM5122), therefore a new driver is necessary. create mode 100644 sound/soc/bcm/hifiberry_dacplus.c diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index f88d2d6..f0bc183 100644 +index 1bee9b5..828f723 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -734,6 +734,7 @@ CONFIG_SND_USB_6FIRE=m +@@ -741,6 +741,7 @@ CONFIG_SND_USB_6FIRE=m CONFIG_SND_SOC=m CONFIG_SND_BCM2708_SOC_I2S=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m @@ -117832,10 +118008,10 @@ index 0000000..c63387b +MODULE_DESCRIPTION("ASoC Driver for HiFiBerry DAC+"); +MODULE_LICENSE("GPL v2"); -From 2f2b25463b8345c39ecc077614810cea585eb650 Mon Sep 17 00:00:00 2001 +From 1e40933aa7a67aa6058a5fee048b3dc1b3959463 Mon Sep 17 00:00:00 2001 From: android Date: Mon, 25 Aug 2014 06:54:19 +0100 -Subject: [PATCH 70/82] bcm2708_fb : Implement blanking support using the +Subject: [PATCH 70/75] bcm2708_fb : Implement blanking support using the mailbox property interface This implementation uses the userspace request style of an array of unsigned @@ -117895,10 +118071,10 @@ index b3b1e04..b25dd5b 100644 const struct fb_fillrect *rect) { -From 5ed8458f11368f365e4280cb714cc77b4b10e9f5 Mon Sep 17 00:00:00 2001 +From d38e5c0aaba6bfa3d409b3c57182edf60acfbe8b Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 71/82] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 71/75] Added driver for HiFiBerry Amp amplifier add-on board The driver contains a low-level hardware driver for the TAS5713 and the drivers for the Raspberry Pi I2S subsystem. @@ -117910,18 +118086,18 @@ drivers for the Raspberry Pi I2S subsystem. sound/soc/bcm/hifiberry_amp.c | 106 +++++++++++ sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + - sound/soc/codecs/tas5713.c | 363 ++++++++++++++++++++++++++++++++++++++ + sound/soc/codecs/tas5713.c | 362 ++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/tas5713.h | 210 ++++++++++++++++++++++ - 9 files changed, 715 insertions(+) + 9 files changed, 714 insertions(+) create mode 100644 sound/soc/bcm/hifiberry_amp.c create mode 100644 sound/soc/codecs/tas5713.c create mode 100644 sound/soc/codecs/tas5713.h diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index f0bc183..873a32e 100644 +index 828f723..13963b9 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -736,6 +736,7 @@ CONFIG_SND_BCM2708_SOC_I2S=m +@@ -743,6 +743,7 @@ CONFIG_SND_BCM2708_SOC_I2S=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m @@ -118159,10 +118335,10 @@ index b4a8a98..e200d60 100644 obj-$(CONFIG_SND_SOC_TLV320AIC23_SPI) += snd-soc-tlv320aic23-spi.o diff --git a/sound/soc/codecs/tas5713.c b/sound/soc/codecs/tas5713.c new file mode 100644 -index 0000000..90accc2 +index 0000000..a24c1da --- /dev/null +++ b/sound/soc/codecs/tas5713.c -@@ -0,0 +1,363 @@ +@@ -0,0 +1,362 @@ +/* + * ASoC Driver for TAS5713 + * @@ -118503,7 +118679,6 @@ index 0000000..90accc2 +static int __init tas5713_modinit(void) +{ + int ret = 0; -+ int err = -1; + + ret = i2c_add_driver(&tas5713_i2c_driver); + if (ret) { @@ -118743,10 +118918,10 @@ index 0000000..8f019e0 + +#endif /* _TAS5713_H */ -From 4699dad488b935bed0f33f09ada533f73acba16a Mon Sep 17 00:00:00 2001 +From 745b4d8d3e64de64ee725202496e82dbbfc012f4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Sep 2014 23:35:44 +0100 -Subject: [PATCH 72/82] bcm2708_fb: Add pan and vsync controls +Subject: [PATCH 72/75] bcm2708_fb: Add pan and vsync controls --- drivers/video/fbdev/bcm2708_fb.c | 56 ++++++++++++++++++++++++++++++++-------- @@ -118858,2403 +119033,10 @@ index b25dd5b..32aaaf5 100644 fb->fb.fix.accel = FB_ACCEL_NONE; -From 56c05623e005be2c02cb1f0f56456da12ef76ba7 Mon Sep 17 00:00:00 2001 -From: Nikesh Oswal -Date: Fri, 25 Jul 2014 12:17:36 +0100 -Subject: [PATCH 73/82] ARM: bcm2708: Limit the boot time interrupt allocation - -Limit the boot time interrupt allocation to RPi related -interrupts only - -Signed-off-by: Nikesh Oswal -Signed-off-by: Manish Gupta ---- - arch/arm/mach-bcm2708/armctrl.c | 2 +- - arch/arm/mach-bcm2708/include/mach/irqs.h | 6 +++++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c -index 42f5e1c..33e1c8b 100644 ---- a/arch/arm/mach-bcm2708/armctrl.c -+++ b/arch/arm/mach-bcm2708/armctrl.c -@@ -298,7 +298,7 @@ int __init armctrl_init(void __iomem * base, unsigned int irq_start, - { - unsigned int irq; - -- for (irq = 0; irq < NR_IRQS; irq++) { -+ for (irq = 0; irq < CORE_IRQS; irq++) { - unsigned int data = irq; - if (irq >= INTERRUPT_JPEG && irq <= INTERRUPT_ARASANSDIO) - data = remap_irqs[irq - INTERRUPT_JPEG]; -diff --git a/arch/arm/mach-bcm2708/include/mach/irqs.h b/arch/arm/mach-bcm2708/include/mach/irqs.h -index 4299054..9e3299a 100644 ---- a/arch/arm/mach-bcm2708/include/mach/irqs.h -+++ b/arch/arm/mach-bcm2708/include/mach/irqs.h -@@ -192,6 +192,10 @@ - #define GPIO_IRQ_START (HARD_IRQS + FIQ_IRQS) - #define GPIO_IRQS (32*5) - #define SPARE_IRQS (64) --#define NR_IRQS (HARD_IRQS+FIQ_IRQS+GPIO_IRQS+SPARE_IRQS) -+#define CORE_IRQS HARD_IRQS+FIQ_IRQS+GPIO_IRQS -+ -+#define BOARD_AUDIO_IRQS 130 -+ -+#define NR_IRQS CORE_IRQS+BOARD_AUDIO_IRQS - - #endif /* _BCM2708_IRQS_H_ */ - -From 8407c0887209b899b0fb8a1ef0bc82fa25d19cc6 Mon Sep 17 00:00:00 2001 -From: Nikesh Oswal -Date: Tue, 19 Aug 2014 15:52:31 +0100 -Subject: [PATCH 74/82] ARM:bcm2708: Add Support for Wolfson Audio Card - -Support for Wolfson Audio card in the BSP - -Signed-off-by: Nikesh Oswal -Signed-off-by: Manish Gupta ---- - arch/arm/mach-bcm2708/bcm2708.c | 154 +++++++++++++++++++++++++- - arch/arm/mach-bcm2708/include/mach/platform.h | 1 + - 2 files changed, 153 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 2f2e11f..7839e31 100644 ---- a/arch/arm/mach-bcm2708/bcm2708.c -+++ b/arch/arm/mach-bcm2708/bcm2708.c -@@ -62,10 +62,17 @@ - #include "bcm2708.h" - #include "armctrl.h" - -+#include -+#include -+#include -+ - #ifdef CONFIG_BCM_VC_CMA - #include - #endif - -+#define GPIO_WM5102_IRQ 27 -+#define GPIO_WM5102_RST 17 -+#define GPIO_WM5102_LDOEN 22 - - /* Effectively we have an IOMMU (ARM<->VideoCore map) that is set up to - * give us IO access only to 64Mbytes of physical memory (26 bits). We could -@@ -609,7 +616,7 @@ static struct platform_device bcm2835_thermal_device = { - .name = "bcm2835_thermal", - }; - --#ifdef CONFIG_SND_BCM2708_SOC_I2S_MODULE -+#if defined(CONFIG_SND_BCM2708_SOC_I2S_MODULE) || defined(CONFIG_SND_BCM2708_SOC_I2S) - static struct resource bcm2708_i2s_resources[] = { - { - .start = I2S_BASE, -@@ -631,6 +638,138 @@ static struct platform_device bcm2708_i2s_device = { - }; - #endif - -+#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE) -+static struct regulator_consumer_supply dc1v8_consumers[] = { -+ REGULATOR_SUPPLY("LDOVDD", "spi0.1"), -+ REGULATOR_SUPPLY("AVDD", "spi0.1"), -+ REGULATOR_SUPPLY("DBVDD1", "spi0.1"), -+ REGULATOR_SUPPLY("CPVDD", "spi0.1"), -+ REGULATOR_SUPPLY("DBVDD2", "wm5102-codec"), -+ REGULATOR_SUPPLY("DBVDD3", "wm5102-codec"), -+ REGULATOR_SUPPLY("CPVDD", "wm5102-codec"), -+ REGULATOR_SUPPLY("PVDD", "1-003a"), -+ REGULATOR_SUPPLY("DVDD", "1-003a"), -+}; -+ -+static struct regulator_init_data dc1v8_data = { -+ .constraints = { -+ .always_on = 1, -+ }, -+ .num_consumer_supplies = ARRAY_SIZE(dc1v8_consumers), -+ .consumer_supplies = dc1v8_consumers, -+}; -+ -+static struct fixed_voltage_config dc1v8vdd_pdata = { -+ .supply_name = "DC_1V8", -+ .microvolts = 1800000, -+ .init_data = &dc1v8_data, -+ .gpio = -1, -+}; -+ -+static struct platform_device dc1v8_device = { -+ .name = "reg-fixed-voltage", -+ .id = 0, -+ .dev = { -+ .platform_data = &dc1v8vdd_pdata, -+ }, -+}; -+ -+static struct regulator_consumer_supply dc5v_consumers[] = { -+ REGULATOR_SUPPLY("SPKVDDL", "wm5102-codec"), -+ REGULATOR_SUPPLY("SPKVDDR", "wm5102-codec"), -+}; -+ -+static struct regulator_init_data dc5v_data = { -+ .constraints = { -+ .always_on = 1, -+ }, -+ .num_consumer_supplies = ARRAY_SIZE(dc5v_consumers), -+ .consumer_supplies = dc5v_consumers, -+}; -+ -+static struct fixed_voltage_config dc5vvdd_pdata = { -+ .supply_name = "DC_5V", -+ .microvolts = 5000000, -+ .init_data = &dc5v_data, -+ .gpio = -1, -+}; -+ -+static struct platform_device dc5v_device = { -+ .name = "reg-fixed-voltage", -+ .id = 1, -+ .dev = { -+ .platform_data = &dc5vvdd_pdata, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_SND_BCM2708_SOC_RPI_CODEC_WSP_MODULE) || defined(CONFIG_SND_BCM2708_SOC_RPI_CODEC_WSP) -+#include -+ -+static struct resource bcm2708_clock_resources[] = { -+ { -+ .start = GPIO_BASE, -+ .end = GPIO_BASE + SZ_4K - 1, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = GPxCLT_BASE, -+ .end = GPxCLT_BASE + 0x14, -+ .flags = IORESOURCE_MEM, -+ } -+}; -+ -+static struct platform_device snd_rpi_wsp_device = { -+ .name = "snd-rpi-wsp", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(bcm2708_clock_resources), -+ .resource = bcm2708_clock_resources, -+}; -+ -+static struct arizona_micd_config wm5102_micd[] = { -+ { 0, 1 << ARIZONA_MICD_BIAS_SRC_SHIFT, 0 }, -+}; -+ -+static struct arizona_pdata snd_rpi_wsp_spi_platform_data = { -+ .reset = GPIO_WM5102_RST, -+ .ldoena = GPIO_WM5102_LDOEN, -+ .irq_flags = IRQF_TRIGGER_HIGH, -+ .gpio_defaults = { -+ [2] = 0x04, /* OPCLK */ -+ [3] = 0x3d, /* ASYNC OPCLK */ -+ }, -+ .micd_configs = wm5102_micd, -+ .num_micd_configs = ARRAY_SIZE(wm5102_micd), -+ .dmic_ref = { -+ [1] = ARIZONA_DMIC_MICBIAS2, -+ }, -+ .inmode = { -+ [1] = ARIZONA_INMODE_DMIC, -+ [2] = ARIZONA_INMODE_SE, -+ }, -+ .clk32k_src = ARIZONA_32KZ_NONE, -+}; -+ -+static struct spi_board_info __initdata snd_rpi_wsp_spi_devices[] = { -+ { -+ .modalias = "wm5102", -+ .platform_data = &snd_rpi_wsp_spi_platform_data, -+ .max_speed_hz = 500000, -+ .bus_num = 0, -+ .chip_select = 1, -+ .mode = SPI_MODE_0, -+ .irq = GPIO_WM5102_IRQ, -+ } -+}; -+ -+static struct i2c_board_info __initdata snd_rpi_wsp_i2c_devices[] = { -+ { -+ I2C_BOARD_INFO("wm8804", 0x3A), -+ }, -+}; -+ -+#endif -+ - #if defined(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) || defined(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC_MODULE) - static struct platform_device snd_hifiberry_dac_device = { - .name = "snd-hifiberry-dac", -@@ -864,7 +1003,7 @@ void __init bcm2708_init(void) - bcm_register_device(&bcm2835_hwmon_device); - bcm_register_device(&bcm2835_thermal_device); - --#ifdef CONFIG_SND_BCM2708_SOC_I2S_MODULE -+#if defined(CONFIG_SND_BCM2708_SOC_I2S_MODULE) || defined(CONFIG_SND_BCM2708_SOC_I2S) - bcm_register_device(&bcm2708_i2s_device); - #endif - -@@ -899,6 +1038,17 @@ void __init bcm2708_init(void) - i2c_register_board_info(1, snd_pcm512x_i2c_devices, ARRAY_SIZE(snd_pcm512x_i2c_devices)); - #endif - -+#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE) -+ bcm_register_device(&dc1v8_device); -+ bcm_register_device(&dc5v_device); -+#endif -+ -+#if defined(CONFIG_SND_BCM2708_SOC_RPI_CODEC_WSP_MODULE) || defined(CONFIG_SND_BCM2708_SOC_RPI_CODEC_WSP) -+ bcm_register_device(&snd_rpi_wsp_device); -+ spi_register_board_info(snd_rpi_wsp_spi_devices, ARRAY_SIZE(snd_rpi_wsp_spi_devices)); -+ i2c_register_board_info(1, snd_rpi_wsp_i2c_devices, -+ ARRAY_SIZE(snd_rpi_wsp_i2c_devices)); -+#endif - - for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { - struct amba_device *d = amba_devs[i]; -diff --git a/arch/arm/mach-bcm2708/include/mach/platform.h b/arch/arm/mach-bcm2708/include/mach/platform.h -index 2e7e1bb..af6bc91 100644 ---- a/arch/arm/mach-bcm2708/include/mach/platform.h -+++ b/arch/arm/mach-bcm2708/include/mach/platform.h -@@ -62,6 +62,7 @@ - #define DMA_BASE (BCM2708_PERI_BASE + 0x7000) /* DMA controller */ - #define ARM_BASE (BCM2708_PERI_BASE + 0xB000) /* BCM2708 ARM control block */ - #define PM_BASE (BCM2708_PERI_BASE + 0x100000) /* Power Management, Reset controller and Watchdog registers */ -+#define GPxCLT_BASE (BCM2708_PERI_BASE + 0x101070) /* Clock Manager General Purpose Clocks Control */ - #define PCM_CLOCK_BASE (BCM2708_PERI_BASE + 0x101098) /* PCM Clock */ - #define RNG_BASE (BCM2708_PERI_BASE + 0x104000) /* Hardware RNG */ - #define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO */ - -From 02264312a27efec56d3ea541fa26bb91ec173fa6 Mon Sep 17 00:00:00 2001 -From: Nikesh Oswal -Date: Tue, 19 Aug 2014 16:02:53 +0100 -Subject: [PATCH 75/82] ASOC: RPI : Add support for Wolfson Audio Card - -Support for Wolfson Audio Card.Added the machine driver. - -Signed-off-by: Nikesh Oswal -Signed-off-by: Manish Gupta -Signed-off-by: ajit.pandey ---- - sound/soc/bcm/Kconfig | 8 + - sound/soc/bcm/Makefile | 2 + - sound/soc/bcm/rpi-wolfson-sound-pi.c | 806 +++++++++++++++++++++++++++++++++++ - 3 files changed, 816 insertions(+) - create mode 100644 sound/soc/bcm/rpi-wolfson-sound-pi.c - -diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index a562ddf..d97eb34 100644 ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -60,3 +60,11 @@ config SND_BCM2708_SOC_IQAUDIO_DAC - select SND_SOC_PCM512x_I2C - help - Say Y or M if you want to add support for IQaudIO-DAC. -+ -+config SND_BCM2708_SOC_RPI_CODEC_WSP -+ tristate "Support for Wolfson sound pi" -+ depends on SND_BCM2708_SOC_I2S -+ select SND_SOC_WM5102 -+ select SND_SOC_WM8804 -+ help -+ Say Y if you want to add support for Wolfson sound pi -diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index 17ea2b0..feec9b5 100644 ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -15,6 +15,7 @@ snd-soc-hifiberry-digi-objs := hifiberry_digi.o - snd-soc-hifiberry-amp-objs := hifiberry_amp.o - snd-soc-rpi-dac-objs := rpi-dac.o - snd-soc-iqaudio-dac-objs := iqaudio-dac.o -+snd-soc-rpi-wsp-objs := rpi-wolfson-sound-pi.o - - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o -@@ -22,3 +23,4 @@ obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI) += snd-soc-hifiberry-digi.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o - obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += snd-soc-rpi-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o -+obj-$(CONFIG_SND_BCM2708_SOC_RPI_CODEC_WSP) += snd-soc-rpi-wsp.o -diff --git a/sound/soc/bcm/rpi-wolfson-sound-pi.c b/sound/soc/bcm/rpi-wolfson-sound-pi.c -new file mode 100644 -index 0000000..40e04fd ---- /dev/null -+++ b/sound/soc/bcm/rpi-wolfson-sound-pi.c -@@ -0,0 +1,806 @@ -+/* -+ * ASoC machine driver for Wolfson Audio Card (with a WM5102 and WM8804 codecs ) -+ * connected to a Raspberry Pi -+ * -+ * Author: Nikesh Oswal, -+ * Copyright 2013/2014 -+ * -+ * Author: Florian Meier, -+ * Copyright 2013 -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "../codecs/wm5102.h" -+#include "../codecs/wm8804.h" -+ -+#define WM8804_CLKOUT_HZ 12000000 -+#define RPI_WSP_DEFAULT_MCLK2 24000000 -+ -+/*TODO: Shift this to platform data*/ -+#define GPIO_WM8804_RST 8 -+#define GPIO_WM8804_MODE 2 -+#define GPIO_WM8804_SW_MODE 23 -+#define GPIO_WM8804_I2C_ADDR 18 -+#define RPI_WLF_SR 44100 -+#define WM5102_MAX_SYSCLK_1 49152000 /*max sysclk for 4K family*/ -+#define WM5102_MAX_SYSCLK_2 45158400 /*max sysclk for 11.025K family*/ -+ -+static struct snd_soc_card snd_rpi_wsp; -+ -+struct wm5102_machine_priv { -+ void __iomem *gpio_base; -+ void __iomem *gpctl_base; -+ struct snd_soc_codec *codec; -+ struct snd_soc_dai *aif[3]; -+ int aif1rate; -+ int wm8804_sr; -+}; -+ -+/* Output clock from GPIO_GCLK(GPIO4) */ -+#define GPIOFSEL(x) (0x00+(x)*4) -+#define GP0CTL (0x00) -+#define GP0DIV (0x04) -+ -+/* Clock register settings */ -+#define BCM2708_CLK_PASSWD (0x5a000000) -+#define BCM2708_CLK_MASH(v) ((v) << 9) -+#define BCM2708_CLK_FLIP (1 << 8) -+#define BCM2708_CLK_BUSY (1 << 7) -+#define BCM2708_CLK_KILL (1 << 5) -+#define BCM2708_CLK_ENAB (1 << 4) -+#define BCM2708_CLK_SRC(v) (v) -+ -+#define BCM2708_CLK_DIVI(v) ((v) << 12) -+#define BCM2708_CLK_DIVF(v) (v) -+ -+static inline void bcm2708_gpio_write_reg(struct wm5102_machine_priv *dev, -+ int reg, u32 val) -+{ -+ __raw_writel(val, dev->gpio_base + reg); -+} -+ -+static inline u32 bcm2708_gpio_read_reg(struct wm5102_machine_priv *dev, int reg) -+{ -+ return __raw_readl(dev->gpio_base + reg); -+} -+ -+static inline void bcm2708_gpctl_write_reg(struct wm5102_machine_priv *dev, -+ int reg, u32 val) -+{ -+ __raw_writel(val, dev->gpctl_base + reg); -+} -+ -+static inline u32 bcm2708_gpctl_read_reg(struct wm5102_machine_priv *dev, int reg) -+{ -+ return __raw_readl(dev->gpctl_base + reg); -+} -+ -+enum { -+ GPIO_FSEL_INPUT, GPIO_FSEL_OUTPUT, -+ GPIO_FSEL_ALT5, GPIO_FSEL_ALT_4, -+ GPIO_FSEL_ALT0, GPIO_FSEL_ALT1, -+ GPIO_FSEL_ALT2, GPIO_FSEL_ALT3, -+}; -+ -+struct GPCTL { -+ char SRC : 4; -+ char ENAB : 1; -+ char KILL : 1; -+ char : 1; -+ char BUSY : 1; -+ char FLIP : 1; -+ char MASH : 2; -+ unsigned int : 13; -+ char PASSWD : 8; -+}; -+ -+enum { -+ BCM2708_CLK_MASH_0 = 0, -+ BCM2708_CLK_MASH_1, -+ BCM2708_CLK_MASH_2, -+ BCM2708_CLK_MASH_3, -+}; -+ -+enum { -+ BCM2708_CLK_SRC_GND = 0, -+ BCM2708_CLK_SRC_OSC, -+ BCM2708_CLK_SRC_DBG0, -+ BCM2708_CLK_SRC_DBG1, -+ BCM2708_CLK_SRC_PLLA, -+ BCM2708_CLK_SRC_PLLC, -+ BCM2708_CLK_SRC_PLLD, -+ BCM2708_CLK_SRC_HDMI, -+}; -+ -+/* Most clocks are not useable (freq = 0) */ -+static const unsigned int bcm2708_clk_freq[BCM2708_CLK_SRC_HDMI+1] = { -+ [BCM2708_CLK_SRC_GND] = 0, -+ [BCM2708_CLK_SRC_OSC] = 19200000, -+ [BCM2708_CLK_SRC_DBG0] = 0, -+ [BCM2708_CLK_SRC_DBG1] = 0, -+ [BCM2708_CLK_SRC_PLLA] = 0, -+ [BCM2708_CLK_SRC_PLLC] = 0, -+ [BCM2708_CLK_SRC_PLLD] = 500000000, -+ [BCM2708_CLK_SRC_HDMI] = 0, -+}; -+ -+static void gpio_gclk_init(void) -+{ -+ unsigned gpiodir; -+ struct snd_soc_card *card = &snd_rpi_wsp; -+ struct wm5102_machine_priv *wm5102 = snd_soc_card_get_drvdata(card); -+ -+ gpiodir = bcm2708_gpio_read_reg(wm5102, GPIOFSEL(0)); -+ gpiodir &= ~(7 << 12); -+ gpiodir |= GPIO_FSEL_ALT0 << 12; -+ bcm2708_gpio_write_reg(wm5102, GPIOFSEL(0), gpiodir); -+} -+ -+static void set_gclk_clock_rate(int clock_rate) -+{ -+ struct snd_soc_card *card = &snd_rpi_wsp; -+ struct wm5102_machine_priv *wm5102 = snd_soc_card_get_drvdata(card); -+ unsigned int mash = BCM2708_CLK_MASH_1; -+ int clk_src = -1; -+ uint64_t dividend; -+ unsigned int divi, divf; -+ -+ clk_src = BCM2708_CLK_SRC_PLLD; -+ -+ dividend = bcm2708_clk_freq[clk_src]; -+ dividend *= 1024; -+ do_div(dividend, clock_rate); -+ divi = dividend / 1024; -+ divf = dividend % 1024; -+ dev_dbg(wm5102->codec->dev, "divi %d, divf %d\n", divi, divf); -+ -+ /* Set clock divider */ -+ bcm2708_gpctl_write_reg(wm5102, GP0DIV, BCM2708_CLK_PASSWD -+ | BCM2708_CLK_DIVI(divi) -+ | BCM2708_CLK_DIVF(divf)); -+ -+ /* Setup clock, but don't start it yet */ -+ bcm2708_gpctl_write_reg(wm5102, GP0CTL, BCM2708_CLK_PASSWD -+ | BCM2708_CLK_MASH(mash) -+ | BCM2708_CLK_SRC(clk_src)); -+} -+ -+static void enable_gclk_clock(bool enable) -+{ -+ unsigned int clkreg; -+ struct snd_soc_card *card = &snd_rpi_wsp; -+ struct wm5102_machine_priv *wm5102 = snd_soc_card_get_drvdata(card); -+ if (enable) { -+ /* start clock*/ -+ clkreg = bcm2708_gpctl_read_reg(wm5102, -+ GP0CTL); -+ bcm2708_gpctl_write_reg(wm5102, GP0CTL, -+ BCM2708_CLK_PASSWD | clkreg | BCM2708_CLK_ENAB); -+ } else { -+ /* stop clock */ -+ clkreg = bcm2708_gpctl_read_reg(wm5102, GP0CTL); -+ bcm2708_gpctl_write_reg(wm5102, GP0CTL, ~(BCM2708_CLK_ENAB) -+ & (BCM2708_CLK_PASSWD | clkreg)); -+ } -+} -+ -+static const struct snd_kcontrol_new rpi_wsp_controls[] = { -+ SOC_DAPM_PIN_SWITCH("DMIC"), -+ SOC_DAPM_PIN_SWITCH("Headset Mic"), -+ SOC_DAPM_PIN_SWITCH("SPDIF out"), -+ SOC_DAPM_PIN_SWITCH("SPDIF in"), -+}; -+ -+const struct snd_soc_dapm_widget rpi_wsp_dapm_widgets[] = { -+ SND_SOC_DAPM_MIC("DMIC", NULL), -+ SND_SOC_DAPM_MIC("Headset Mic", NULL), -+ SND_SOC_DAPM_MIC("Line Input", NULL), -+ /* Create widgets for SPDIF output and input */ -+ SND_SOC_DAPM_OUTPUT("SPDIF out"), -+ SND_SOC_DAPM_INPUT("SPDIF in"), -+}; -+ -+const struct snd_soc_dapm_route rpi_wsp_dapm_routes[] = { -+ { "IN1L", NULL, "Headset Mic" }, -+ { "IN1R", NULL, "Headset Mic" }, -+ { "Headset Mic", NULL, "MICBIAS1" }, -+ -+ { "IN2L", NULL, "DMIC" }, -+ { "IN2R", NULL, "DMIC" }, -+ { "DMIC", NULL, "MICBIAS2" }, -+ -+ { "IN3L", NULL, "Line Input" }, -+ { "IN3R", NULL, "Line Input" }, -+ { "Line Input", NULL, "MICVDD" }, -+ -+ { "SPDIF out", NULL, "Playback" }, -+ { "Capture", NULL, "SPDIF in" }, -+ { "SYSCLK", NULL, "OPCLK" }, -+ { "ASYNCCLK", NULL, "ASYNCOPCLK" }, -+}; -+static int rpi_set_bias_level(struct snd_soc_card *card, -+ struct snd_soc_dapm_context *dapm, -+ enum snd_soc_bias_level level) -+{ -+ struct snd_soc_codec *wm8804_codec = card->rtd[1].codec; -+ -+ switch (level) { -+ case SND_SOC_BIAS_STANDBY: -+ if (dapm->bias_level != SND_SOC_BIAS_OFF) -+ break; -+ -+ snd_soc_update_bits(wm8804_codec, WM8804_PWRDN, 0x8, 0x0); -+ break; -+ case SND_SOC_BIAS_PREPARE: -+ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) -+ break; -+ -+ snd_soc_update_bits(wm8804_codec, WM8804_PWRDN, 0x1, 0x0); -+ break; -+ default: -+ break; -+ } -+ -+ return 0; -+} -+static int rpi_set_bias_level_post(struct snd_soc_card *card, -+ struct snd_soc_dapm_context *dapm, -+ enum snd_soc_bias_level level) -+{ -+ struct snd_soc_codec *wm8804_codec = card->rtd[1].codec; -+ -+ switch (level) { -+ case SND_SOC_BIAS_OFF: -+ snd_soc_update_bits(wm8804_codec, WM8804_PWRDN, 0x8, 0x8); -+ break; -+ case SND_SOC_BIAS_STANDBY: -+ snd_soc_update_bits(wm8804_codec, WM8804_PWRDN, 0x1, 0x1); -+ break; -+ default: -+ break; -+ } -+ -+ dapm->bias_level = level; -+ -+ return 0; -+} -+static void bcm2708_set_gpio_out(int pin) -+{ -+ /* -+ * This is the common way to handle the GPIO pins for -+ * the Raspberry Pi. -+ * TODO This is a hack. Use pinmux / pinctrl. -+ */ -+#define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3)) -+#define SET_GPIO_OUT(g) *(gpio+(((g)/10))) |= (1<<(((g)%10)*3)) -+ unsigned int *gpio; -+ gpio = ioremap(GPIO_BASE, SZ_16K); -+ INP_GPIO(pin); -+ SET_GPIO_OUT(pin); -+ iounmap(gpio); -+#undef INP_GPIO -+#undef SET_GPIO_OUT -+ -+} -+ -+static void bcm2708_set_gpio_alt(int pin, int alt) -+{ -+ /* -+ * This is the common way to handle the GPIO pins for -+ * the Raspberry Pi. -+ * TODO This is a hack. Use pinmux / pinctrl. -+ */ -+#define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3)) -+#define SET_GPIO_ALT(g,a) *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3)) -+ unsigned int *gpio; -+ gpio = ioremap(GPIO_BASE, SZ_16K); -+ INP_GPIO(pin); -+ SET_GPIO_ALT(pin, alt); -+ iounmap(gpio); -+#undef INP_GPIO -+#undef SET_GPIO_ALT -+} -+ -+static int wm8804_reset(void) -+ { -+ int ret; -+ -+ if (!gpio_is_valid(GPIO_WM8804_RST)) { -+ pr_err("Skipping unavailable gpio %d (%s)\n", GPIO_WM8804_RST, "wm8804_rst"); -+ return -ENOMEM; -+ } -+ -+ if (!gpio_is_valid(GPIO_WM8804_MODE)) { -+ pr_err("Skipping unavailable gpio %d (%s)\n", GPIO_WM8804_MODE, "wm8804_mode"); -+ return -ENOMEM; -+ } -+ -+ if (!gpio_is_valid(GPIO_WM8804_SW_MODE)) { -+ pr_err("Skipping unavailable gpio %d (%s)\n", GPIO_WM8804_SW_MODE, "wm8804_sw_mode"); -+ return -ENOMEM; -+ } -+ -+ if (!gpio_is_valid(GPIO_WM8804_I2C_ADDR)) { -+ pr_err("Skipping unavailable gpio %d (%s)\n", GPIO_WM8804_I2C_ADDR, "wm8804_i2c_addr"); -+ return -ENOMEM; -+ } -+ -+ ret = gpio_request(GPIO_WM8804_RST, "wm8804_rst"); -+ if (ret < 0) { -+ pr_err("gpio_request wm8804_rst failed\n"); -+ return ret; -+ } -+ -+ /*GPIO2 is used for SW/HW Mode Select and after Reset the same pin is used as -+ I2C data line, so initially it is configured as GPIO OUT from BCM perspective*/ -+ bcm2708_set_gpio_out(GPIO_WM8804_MODE); -+ -+ ret = gpio_request(GPIO_WM8804_MODE, "wm8804_mode"); -+ if (ret < 0) { -+ pr_err("gpio_request wm8804_mode failed\n"); -+ return ret; -+ } -+ -+ ret = gpio_request(GPIO_WM8804_SW_MODE, "wm8804_sw_mode"); -+ if (ret < 0) { -+ pr_err("gpio_request wm8804_sw_mode failed\n"); -+ return ret; -+ } -+ -+ ret = gpio_request(GPIO_WM8804_I2C_ADDR, "wm8804_i2c_addr"); -+ if (ret < 0) { -+ pr_err("gpio_request wm8804_i2c_addr failed\n"); -+ return ret; -+ } -+ -+ /*Set SW Mode*/ -+ ret = gpio_direction_output(GPIO_WM8804_MODE, 1); -+ if (ret < 0) { -+ pr_err("gpio_direction_output wm8804_mode failed\n"); -+ } -+ -+ /*Set 2 Wire (I2C) Mode*/ -+ ret = gpio_direction_output(GPIO_WM8804_SW_MODE, 0); -+ if (ret < 0) { -+ pr_err("gpio_direction_output wm8804_sw_mode failed\n"); -+ } -+ -+ /*Set 2 Wire (I2C) Addr to 0x3A, writing 1 will make the Addr as 0x3B*/ -+ ret = gpio_direction_output(GPIO_WM8804_I2C_ADDR, 0); -+ if (ret < 0) { -+ pr_err("gpio_direction_output wm8804_i2c_addr failed\n"); -+ } -+ -+ /*Take WM8804 out of reset*/ -+ ret = gpio_direction_output(GPIO_WM8804_RST, 1); -+ if (ret < 0) { -+ pr_err("gpio_direction_output wm8804_rst failed\n"); -+ } -+ -+ /*Put WM8804 in reset*/ -+ gpio_set_value(GPIO_WM8804_RST, 0); -+ mdelay(500); -+ /*Take WM8804 out of reset*/ -+ gpio_set_value(GPIO_WM8804_RST, 1); -+ mdelay(500); -+ -+ gpio_free(GPIO_WM8804_RST); -+ gpio_free(GPIO_WM8804_MODE); -+ gpio_free(GPIO_WM8804_SW_MODE); -+ gpio_free(GPIO_WM8804_I2C_ADDR); -+ -+ /*GPIO2 is used for SW/HW Mode Select and after Reset the same pin is used as -+ I2C data line, so after reset it is configured as I2C data line i.e ALT0 function*/ -+ bcm2708_set_gpio_alt(GPIO_WM8804_MODE, 0); -+ -+ return ret; -+} -+ -+static int snd_rpi_wsp_config_5102_clks(struct snd_soc_codec *wm5102_codec, int sr, bool enable_fllsync) -+{ -+ int ret; -+ int sr_mult = (sr % 4000 == 0) ? (WM5102_MAX_SYSCLK_1/sr) : (WM5102_MAX_SYSCLK_2/sr); -+ -+ /*reset FLL1*/ -+ snd_soc_codec_set_pll(wm5102_codec, WM5102_FLL1_REFCLK, -+ ARIZONA_FLL_SRC_NONE, 0, 0); -+ snd_soc_codec_set_pll(wm5102_codec, WM5102_FLL1, -+ ARIZONA_FLL_SRC_NONE, 0, 0); -+ -+ if (enable_fllsync) { -+ ret = snd_soc_codec_set_pll(wm5102_codec, WM5102_FLL1_REFCLK, -+ ARIZONA_CLK_SRC_MCLK1, -+ WM8804_CLKOUT_HZ, -+ sr * sr_mult); -+ if (ret != 0) { -+ dev_err(wm5102_codec->dev, "Failed to enable FLL1 with Ref Clock Loop: %d\n", ret); -+ return ret; -+ } -+ -+ ret = snd_soc_codec_set_pll(wm5102_codec, WM5102_FLL1, -+ ARIZONA_CLK_SRC_AIF2BCLK, -+ sr * 64, sr * sr_mult); -+ if (ret != 0) { -+ dev_err(wm5102_codec->dev, "Failed to enable FLL1 Sync Clock Loop: %d\n", ret); -+ return ret; -+ } -+ } else { -+ ret = snd_soc_codec_set_pll(wm5102_codec, WM5102_FLL1, -+ ARIZONA_CLK_SRC_MCLK1, -+ WM8804_CLKOUT_HZ, -+ sr * sr_mult); -+ if (ret != 0) { -+ dev_err(wm5102_codec->dev, "Failed to enable FLL1 with Ref Clock Loop: %d\n", ret); -+ return ret; -+ } -+ } -+ -+ ret = snd_soc_codec_set_sysclk(wm5102_codec, -+ ARIZONA_CLK_SYSCLK, -+ ARIZONA_CLK_SRC_FLL1, -+ sr * sr_mult, -+ SND_SOC_CLOCK_IN); -+ if (ret != 0) { -+ dev_err(wm5102_codec->dev, "Failed to set AYNCCLK: %d\n", ret); -+ return ret; -+ } -+ -+ ret = snd_soc_codec_set_sysclk(wm5102_codec, -+ ARIZONA_CLK_OPCLK, 0, -+ sr * sr_mult, -+ SND_SOC_CLOCK_OUT); -+ if (ret != 0) { -+ dev_err(wm5102_codec->dev, "Failed to set OPCLK: %d\n", ret); -+ return ret; -+ } -+ -+ return 0; -+ } -+ -+static int snd_rpi_wsp_config_8804_clks(struct snd_soc_codec *wm8804_codec, -+ struct snd_soc_dai *wm8804_dai, int sr) -+ { -+ int ret; -+ -+ /*Set OSC(12MHz) to CLK2 freq*/ -+ /*Based on MCLKDIV it will be 128fs (MCLKDIV=1) or 256fs mode (MCLKDIV=0)*/ -+ /*BCLK will be MCLK/2 (MCLKDIV=1) or MCLK/4 (MCLKDIV=0) so BCLK is 64fs always*/ -+ ret = snd_soc_dai_set_pll(wm8804_dai, 0, 0, WM8804_CLKOUT_HZ, sr * 256); -+ if (ret != 0) { -+ dev_err(wm8804_codec->dev, "Failed to set OSC to CLK2 frequency: %d\n", ret); -+ return ret; -+ } -+ -+ /*Set MCLK as PLL Output*/ -+ ret = snd_soc_dai_set_sysclk(wm8804_dai, WM8804_TX_CLKSRC_PLL, sr * 256, 0); -+ if (ret != 0) { -+ dev_err(wm8804_codec->dev, "Failed to set MCLK as PLL Output: %d\n", ret); -+ return ret; -+ } -+ -+ /*Fix MCLKDIV=0 for 256fs to avoid any issues switching between TX and RX. RX always expects 256fs*/ -+ ret = snd_soc_dai_set_clkdiv(wm8804_dai, WM8804_MCLK_DIV, 0 ); -+ if (ret != 0) { -+ dev_err(wm8804_codec->dev, "Failed to set MCLK_DIV to 256fs: %d\n", ret); -+ return ret; -+ } -+ -+ /*Set CLKOUT as OSC Frequency*/ -+ ret = snd_soc_dai_set_sysclk(wm8804_dai, WM8804_CLKOUT_SRC_OSCCLK, WM8804_CLKOUT_HZ, 0); -+ if (ret != 0) { -+ dev_err(wm8804_codec->dev, "Failed to set CLKOUT as OSC Frequency: %d\n", ret); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int snd_rpi_wsp_config_clks(struct snd_soc_codec *wm8804_codec, -+ struct snd_soc_codec *wm5102_codec, struct snd_soc_dai *wm8804_dai, -+ int sr, bool enable_fllsync,int wm8804_rxtx_status) -+{ -+ int ret=0,rx_disabled,tx_disabled; -+ -+ rx_disabled = wm8804_rxtx_status & 0x2; -+ tx_disabled = wm8804_rxtx_status & 0x4; -+ -+ if(!rx_disabled || !tx_disabled){ -+ ret = snd_rpi_wsp_config_8804_clks(wm8804_codec, wm8804_dai,sr); -+ -+ if (ret != 0) { -+ dev_err(wm8804_codec->dev, "snd_rpi_wsp_config_8804_clks failed: %d\n", ret); -+ return ret; -+ } -+ -+ } -+ -+ ret = snd_rpi_wsp_config_5102_clks(wm5102_codec, sr, enable_fllsync); -+ if (ret != 0) { -+ dev_err(wm5102_codec->dev, "snd_rpi_wsp_config_5102_clks failed: %d\n", ret); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int snd_rpi_wsp_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_card *card = rtd->card; -+ struct snd_soc_codec *wm5102_codec = rtd->codec; -+ struct snd_soc_dai *bcm_i2s_dai = rtd->cpu_dai; -+ struct snd_soc_codec *wm8804_codec = card->rtd[1].codec; -+ struct snd_soc_dai *wm8804_codec_dai = card->rtd[1].codec_dai; -+ struct wm5102_machine_priv *priv = snd_soc_card_get_drvdata(card); -+ int ret, rxtx_status,rx_disabled,capture_stream_opened; -+ bool enable_fllsync; -+ unsigned int bclkratio; -+ -+ bclkratio = 2 * snd_pcm_format_physical_width(params_format(params)); -+ if (bcm_i2s_dai->driver->ops->set_bclk_ratio) { -+ ret = bcm_i2s_dai->driver->ops->set_bclk_ratio(bcm_i2s_dai, bclkratio); -+ if (ret < 0) { -+ dev_err(wm5102_codec->dev, "set_bclk_ratio failed: %d\n", ret); -+ return ret; -+ } -+ } -+ -+ rxtx_status = snd_soc_read(wm8804_codec, WM8804_PWRDN); -+ rx_disabled = rxtx_status & 0x2; -+ -+ capture_stream_opened = -+ substream->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_opened; -+ -+ if (capture_stream_opened && !rx_disabled) -+ enable_fllsync = true; -+ else -+ enable_fllsync = false; -+ -+ -+ ret = snd_rpi_wsp_config_clks(wm8804_codec, wm5102_codec, -+ wm8804_codec_dai, -+ params_rate(params), -+ enable_fllsync, -+ rxtx_status); -+ -+ priv->wm8804_sr = params_rate(params); -+ -+ return 0; -+} -+ -+static int snd_rpi_wsp_hw_free(struct snd_pcm_substream *substream) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *wm5102_codec = rtd->codec; -+ int ret,playback_stream_opened,capture_stream_opened; -+ -+ playback_stream_opened = substream->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_opened; -+ -+ capture_stream_opened = substream->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_opened; -+ -+ if((playback_stream_opened + capture_stream_opened) == 1){ -+ -+ ret = snd_soc_codec_set_sysclk(wm5102_codec, -+ ARIZONA_CLK_SYSCLK, -+ ARIZONA_CLK_SRC_FLL1, -+ 0, -+ SND_SOC_CLOCK_IN); -+ -+ if (ret != 0) { -+ dev_err(wm5102_codec->dev, "Failed to set SYSCLK to Zero: %d\n", ret); -+ return ret; -+ } -+ } -+ -+ return 0; -+} -+ -+static struct snd_soc_ops snd_rpi_wsp_ops = { -+ .hw_params = snd_rpi_wsp_hw_params, -+ .hw_free = snd_rpi_wsp_hw_free, -+}; -+ -+static struct snd_soc_pcm_stream dai_link2_params = { -+ .formats = SNDRV_PCM_FMTBIT_S24_LE, -+ .rate_min = RPI_WLF_SR, -+ .rate_max = RPI_WLF_SR, -+ .channels_min = 2, -+ .channels_max = 2, -+}; -+ -+static struct snd_soc_dai_link snd_rpi_wsp_dai[] = { -+ { -+ .name = "WM5102", -+ .stream_name = "WM5102 AiFi", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "wm5102-aif1", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "wm5102-codec", -+ .dai_fmt = SND_SOC_DAIFMT_I2S -+ | SND_SOC_DAIFMT_NB_NF -+ | SND_SOC_DAIFMT_CBM_CFM, -+ .ops = &snd_rpi_wsp_ops, -+ }, -+ { -+ .name = "WM5102 SPDIF", -+ .stream_name = "SPDIF Tx/Rx", -+ .cpu_dai_name = "wm5102-aif2", -+ .codec_dai_name = "wm8804-spdif", -+ .codec_name = "wm8804.1-003a", -+ .dai_fmt = SND_SOC_DAIFMT_I2S -+ | SND_SOC_DAIFMT_NB_NF -+ | SND_SOC_DAIFMT_CBM_CFM, -+ .ignore_suspend = 1, -+ .params = &dai_link2_params, -+ }, -+}; -+ -+static int snd_rpi_wsp_late_probe(struct snd_soc_card *card) -+{ -+ struct snd_soc_codec *codec = card->rtd[0].codec; -+ struct wm5102_machine_priv *priv = snd_soc_card_get_drvdata(codec->card); -+ int i, ret; -+ -+ priv->codec = codec; -+ priv->wm8804_sr = RPI_WLF_SR; -+ -+ for (i = 0; i < ARRAY_SIZE(snd_rpi_wsp_dai); i++) -+ priv->aif[i] = card->rtd[i].codec_dai; -+ -+ ret = snd_soc_codec_set_sysclk(card->rtd[0].codec, ARIZONA_CLK_SYSCLK, ARIZONA_CLK_SRC_FLL1, -+ 0, SND_SOC_CLOCK_IN); -+ if (ret != 0) { -+ dev_err(card->rtd[0].codec->dev, "Failed to set SYSCLK to Zero: %d\n", ret); -+ return ret; -+ } -+ -+ ret = snd_rpi_wsp_config_8804_clks(card->rtd[1].codec, card->rtd[1].codec_dai, RPI_WLF_SR); -+ -+ if (ret != 0) { -+ dev_err(card->rtd[1].codec->dev, "snd_rpi_wsp_config_8804_clks failed: %d\n", ret); -+ return ret; -+ } -+ -+ ret = snd_soc_dai_set_sysclk(card->rtd[0].codec_dai, ARIZONA_CLK_SYSCLK, 0, 0); -+ if (ret != 0) { -+ dev_err(card->rtd[0].codec->dev, "Failed to set codec dai clk domain: %d\n", ret); -+ return ret; -+ } -+ -+ ret = snd_soc_dai_set_sysclk(card->rtd[1].cpu_dai, ARIZONA_CLK_SYSCLK, 0, 0); -+ if (ret != 0) { -+ dev_err(card->rtd[0].codec->dev, "Failed to set codec dai clk domain: %d\n", ret); -+ return ret; -+ } -+ -+ /*Configure SAMPLE_RATE_1 and ASYNC_SAMPLE_RATE_1 by default to -+ 44.1KHz these values can be changed in runtime by corresponding -+ DAI hw_params callback */ -+ snd_soc_update_bits(card->rtd[0].codec, ARIZONA_SAMPLE_RATE_1, -+ ARIZONA_SAMPLE_RATE_1_MASK, 0x0B); -+ snd_soc_update_bits(card->rtd[0].codec, ARIZONA_ASYNC_SAMPLE_RATE_1, -+ ARIZONA_ASYNC_SAMPLE_RATE_MASK, 0x0B); -+ -+ return 0; -+} -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_rpi_wsp = { -+ .name = "snd_rpi_wsp", -+ .dai_link = snd_rpi_wsp_dai, -+ .num_links = ARRAY_SIZE(snd_rpi_wsp_dai), -+ .late_probe = snd_rpi_wsp_late_probe, -+ .controls = rpi_wsp_controls, -+ .num_controls = ARRAY_SIZE(rpi_wsp_controls), -+ .dapm_widgets = rpi_wsp_dapm_widgets, -+ .num_dapm_widgets = ARRAY_SIZE(rpi_wsp_dapm_widgets), -+ .dapm_routes = rpi_wsp_dapm_routes, -+ .num_dapm_routes = ARRAY_SIZE(rpi_wsp_dapm_routes), -+ .set_bias_level = rpi_set_bias_level, -+ .set_bias_level_post = rpi_set_bias_level_post, -+}; -+ -+static int snd_rpi_wsp_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ int i; -+ struct wm5102_machine_priv *wm5102; -+ -+ void __iomem *base[2]; -+ -+ /* request both ioareas */ -+ for (i = 0; i < ARRAY_SIZE(base); i++) { -+ struct resource *mem, *ioarea; -+ mem = platform_get_resource(pdev, IORESOURCE_MEM, i); -+ if (!mem) { -+ dev_err(&pdev->dev, "%s: Memory resource could not be found\n", __func__); -+ return -ENODEV; -+ } -+ -+ ioarea = devm_request_mem_region(&pdev->dev, mem->start, -+ resource_size(mem), -+ pdev->name); -+ if (!ioarea) { -+ dev_err(&pdev->dev, "%s: Memory region already claimed\n", __func__); -+ return -EBUSY; -+ } -+ -+ base[i] = devm_ioremap(&pdev->dev, mem->start, -+ resource_size(mem)); -+ if (!base[i]) { -+ dev_err(&pdev->dev, "%s: ioremap failed\n", __func__); -+ return -ENOMEM; -+ } -+ } -+ -+ wm8804_reset(); -+ -+ wm5102 = kzalloc(sizeof *wm5102, GFP_KERNEL); -+ if (!wm5102) -+ return -ENOMEM; -+ -+ wm5102->gpio_base = base[0]; -+ wm5102->gpctl_base = base[1]; -+ -+ snd_soc_card_set_drvdata(&snd_rpi_wsp, wm5102); -+ -+ gpio_gclk_init(); -+ set_gclk_clock_rate(RPI_WSP_DEFAULT_MCLK2); -+ enable_gclk_clock(true); -+ -+ snd_rpi_wsp.dev = &pdev->dev; -+ ret = snd_soc_register_card(&snd_rpi_wsp); -+ if (ret) { -+ dev_err(&pdev->dev, "Failed to register card: %d\n", ret); -+ kfree(wm5102); -+ } -+ -+ return ret; -+} -+ -+static int snd_rpi_wsp_remove(struct platform_device *pdev) -+{ -+ struct snd_soc_card *card = &snd_rpi_wsp; -+ struct wm5102_machine_priv *wm5102 = snd_soc_card_get_drvdata(card); -+ -+ snd_soc_unregister_card(&snd_rpi_wsp); -+ enable_gclk_clock(false); -+ kfree(wm5102); -+ -+ return 0; -+} -+ -+static struct platform_driver snd_rpi_wsp_driver = { -+ .driver = { -+ .name = "snd-rpi-wsp", -+ .owner = THIS_MODULE, -+ }, -+ .probe = snd_rpi_wsp_probe, -+ .remove = snd_rpi_wsp_remove, -+}; -+ -+module_platform_driver(snd_rpi_wsp_driver); -+ -+MODULE_AUTHOR("Nikesh Oswal"); -+MODULE_AUTHOR("Liu Xin"); -+MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to Wolfson sound pi"); -+MODULE_LICENSE("GPL"); - -From 937f9fd7c8e81ac26e9ea09cfc7b0d1828d9fecc Mon Sep 17 00:00:00 2001 -From: Manish Gupta -Date: Wed, 17 Sep 2014 10:44:19 +0100 -Subject: [PATCH 76/82] config:RPI: Add config support for wolfson audio card - -Signed-off-by: Manish Gupta -Signed-off-by: ajit.pandey ---- - arch/arm/configs/bcmrpi_defconfig | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 873a32e..ac14ae4 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -538,6 +538,7 @@ CONFIG_SPI=y - CONFIG_SPI_BCM2708=m - CONFIG_SPI_SPIDEV=y - CONFIG_GPIO_SYSFS=y -+CONFIG_GPIO_ARIZONA=m - CONFIG_W1=m - CONFIG_W1_MASTER_DS2490=m - CONFIG_W1_MASTER_DS2482=m -@@ -561,6 +562,12 @@ CONFIG_THERMAL=y - CONFIG_THERMAL_BCM2835=y - CONFIG_WATCHDOG=y - CONFIG_BCM2708_WDT=m -+CONFIG_MFD_ARIZONA_I2C=m -+CONFIG_MFD_ARIZONA_SPI=m -+CONFIG_MFD_WM5102=y -+CONFIG_REGULATOR=y -+CONFIG_REGULATOR_FIXED_VOLTAGE=m -+CONFIG_REGULATOR_ARIZONA=m - CONFIG_MEDIA_SUPPORT=m - CONFIG_MEDIA_CAMERA_SUPPORT=y - CONFIG_MEDIA_ANALOG_TV_SUPPORT=y -@@ -739,6 +746,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m - CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m - CONFIG_SND_BCM2708_SOC_RPI_DAC=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m -+CONFIG_SND_BCM2708_SOC_RPI_CODEC_WSP=m - CONFIG_SND_SIMPLE_CARD=m - CONFIG_SOUND_PRIME=m - CONFIG_HIDRAW=y -@@ -955,6 +963,8 @@ CONFIG_LIRC_RPI=m - CONFIG_LIRC_SASEM=m - CONFIG_LIRC_SERIAL=m - # CONFIG_IOMMU_SUPPORT is not set -+CONFIG_EXTCON=m -+CONFIG_EXTCON_ARIZONA=m - CONFIG_EXT4_FS=y - CONFIG_EXT4_FS_POSIX_ACL=y - CONFIG_EXT4_FS_SECURITY=y - -From 1b50c00bfcdd05f63fb652445c4cde5693fe7144 Mon Sep 17 00:00:00 2001 -From: Manish Gupta -Date: Fri, 26 Sep 2014 16:24:07 +0530 -Subject: [PATCH 77/82] ASoC:RPI: DMA channels 2 and 3 to be set in FAST mode - -Changing th DMA Channels 2 and 3 to be registered under -fast mode and not lite mode.Lite engine mode certainly -half the bandwidth of a normal DMA engine. - -Signed-off-by: Manish Gupta ---- - drivers/dma/bcm2708-dmaengine.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/dma/bcm2708-dmaengine.c b/drivers/dma/bcm2708-dmaengine.c -index 6766799..9ad63e0 100644 ---- a/drivers/dma/bcm2708-dmaengine.c -+++ b/drivers/dma/bcm2708-dmaengine.c -@@ -859,7 +859,7 @@ static int bcm2835_dma_probe(struct platform_device *pdev) - void __iomem *chan_base; - int chan_id; - -- chan_id = bcm_dma_chan_alloc(BCM_DMA_FEATURE_LITE, -+ chan_id = bcm_dma_chan_alloc(BCM_DMA_FEATURE_FAST, - &chan_base, - &irq); - - -From 0fa6b31cec5d82bfffd0762765c82d5d6c1caaac Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 8 Oct 2014 21:14:48 +0100 -Subject: [PATCH 78/82] ASOC: RPI: Avoid build issue with 3.17 - ---- - sound/soc/bcm/rpi-wolfson-sound-pi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sound/soc/bcm/rpi-wolfson-sound-pi.c b/sound/soc/bcm/rpi-wolfson-sound-pi.c -index 40e04fd..900ce3d 100644 ---- a/sound/soc/bcm/rpi-wolfson-sound-pi.c -+++ b/sound/soc/bcm/rpi-wolfson-sound-pi.c -@@ -657,7 +657,7 @@ static struct snd_soc_dai_link snd_rpi_wsp_dai[] = { - static int snd_rpi_wsp_late_probe(struct snd_soc_card *card) - { - struct snd_soc_codec *codec = card->rtd[0].codec; -- struct wm5102_machine_priv *priv = snd_soc_card_get_drvdata(codec->card); -+ struct wm5102_machine_priv *priv = snd_soc_card_get_drvdata(card); - int i, ret; - - priv->codec = codec; - -From d8cd2263493ac6319708b38965ab00aebef358b1 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 9 Oct 2014 16:12:33 +0100 -Subject: [PATCH 79/82] vchiq: Move logging control into debugfs - ---- - drivers/misc/vc04_services/Makefile | 2 +- - .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 138 +++----- - .../vc04_services/interface/vchiq_arm/vchiq_arm.h | 31 +- - .../interface/vchiq_arm/vchiq_debugfs.c | 383 +++++++++++++++++++++ - .../interface/vchiq_arm/vchiq_debugfs.h | 52 +++ - .../vc04_services/interface/vchiq_arm/vchiq_proc.c | 253 -------------- - 6 files changed, 514 insertions(+), 345 deletions(-) - create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c - create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h - delete mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c - -diff --git a/drivers/misc/vc04_services/Makefile b/drivers/misc/vc04_services/Makefile -index 4224f58..0c82520 100644 ---- a/drivers/misc/vc04_services/Makefile -+++ b/drivers/misc/vc04_services/Makefile -@@ -7,7 +7,7 @@ vchiq-objs := \ - interface/vchiq_arm/vchiq_arm.o \ - interface/vchiq_arm/vchiq_kern_lib.o \ - interface/vchiq_arm/vchiq_2835_arm.o \ -- interface/vchiq_arm/vchiq_proc.o \ -+ interface/vchiq_arm/vchiq_debugfs.o \ - interface/vchiq_arm/vchiq_shim.o \ - interface/vchiq_arm/vchiq_util.o \ - interface/vchiq_arm/vchiq_connected.o \ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c -index 98edf1b..dbd530c 100644 ---- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -1,4 +1,5 @@ - /** -+ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved. - * Copyright (c) 2010-2012 Broadcom. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without -@@ -44,12 +45,12 @@ - #include - #include - #include --#include - - #include "vchiq_core.h" - #include "vchiq_ioctl.h" - #include "vchiq_arm.h" - #include "vchiq_killable.h" -+#include "vchiq_debugfs.h" - - #define DEVICE_NAME "vchiq" - -@@ -105,8 +106,6 @@ static const char *const resume_state_names[] = { - - - static void suspend_timer_callback(unsigned long context); --static int vchiq_proc_add_instance(VCHIQ_INSTANCE_T instance); --static void vchiq_proc_remove_instance(VCHIQ_INSTANCE_T instance); - - - typedef struct user_service_struct { -@@ -145,11 +144,12 @@ struct vchiq_instance_struct { - int pid; - int mark; - int use_close_delivered; -+ int trace; - - struct list_head bulk_waiter_list; - struct mutex bulk_waiter_list_mutex; - -- struct proc_dir_entry *proc_entry; -+ VCHIQ_DEBUGFS_NODE_T debugfs_node; - }; - - typedef struct dump_context_struct { -@@ -1135,7 +1135,7 @@ vchiq_open(struct inode *inode, struct file *file) - instance->state = state; - instance->pid = current->tgid; - -- ret = vchiq_proc_add_instance(instance); -+ ret = vchiq_debugfs_add_instance(instance); - if (ret != 0) { - kfree(instance); - return ret; -@@ -1288,7 +1288,7 @@ vchiq_release(struct inode *inode, struct file *file) - } - } - -- vchiq_proc_remove_instance(instance); -+ vchiq_debugfs_remove_instance(instance); - - kfree(instance); - file->private_data = NULL; -@@ -2542,6 +2542,52 @@ vchiq_release_service_internal(VCHIQ_SERVICE_T *service) - return vchiq_release_internal(service->state, service); - } - -+VCHIQ_DEBUGFS_NODE_T * -+vchiq_instance_get_debugfs_node(VCHIQ_INSTANCE_T instance) -+{ -+ return &instance->debugfs_node; -+} -+ -+int -+vchiq_instance_get_use_count(VCHIQ_INSTANCE_T instance) -+{ -+ VCHIQ_SERVICE_T *service; -+ int use_count = 0, i; -+ i = 0; -+ while ((service = next_service_by_instance(instance->state, -+ instance, &i)) != NULL) { -+ use_count += service->service_use_count; -+ unlock_service(service); -+ } -+ return use_count; -+} -+ -+int -+vchiq_instance_get_pid(VCHIQ_INSTANCE_T instance) -+{ -+ return instance->pid; -+} -+ -+int -+vchiq_instance_get_trace(VCHIQ_INSTANCE_T instance) -+{ -+ return instance->trace; -+} -+ -+void -+vchiq_instance_set_trace(VCHIQ_INSTANCE_T instance, int trace) -+{ -+ VCHIQ_SERVICE_T *service; -+ int i; -+ i = 0; -+ while ((service = next_service_by_instance(instance->state, -+ instance, &i)) != NULL) { -+ service->trace = trace; -+ unlock_service(service); -+ } -+ instance->trace = (trace != 0); -+} -+ - static void suspend_timer_callback(unsigned long context) - { - VCHIQ_STATE_T *state = (VCHIQ_STATE_T *)context; -@@ -2757,10 +2803,10 @@ vchiq_init(void) - int err; - void *ptr_err; - -- /* create proc entries */ -- err = vchiq_proc_init(); -+ /* create debugfs entries */ -+ err = vchiq_debugfs_init(); - if (err != 0) -- goto failed_proc_init; -+ goto failed_debugfs_init; - - err = alloc_chrdev_region(&vchiq_devid, VCHIQ_MINOR, 1, DEVICE_NAME); - if (err != 0) { -@@ -2810,82 +2856,12 @@ vchiq_init(void) - failed_cdev_add: - unregister_chrdev_region(vchiq_devid, 1); - failed_alloc_chrdev: -- vchiq_proc_deinit(); --failed_proc_init: -+ vchiq_debugfs_deinit(); -+failed_debugfs_init: - vchiq_log_warning(vchiq_arm_log_level, "could not load vchiq"); - return err; - } - --static int vchiq_instance_get_use_count(VCHIQ_INSTANCE_T instance) --{ -- VCHIQ_SERVICE_T *service; -- int use_count = 0, i; -- i = 0; -- while ((service = next_service_by_instance(instance->state, -- instance, &i)) != NULL) { -- use_count += service->service_use_count; -- unlock_service(service); -- } -- return use_count; --} -- --/* read the per-process use-count */ --static int proc_read_use_count(char *page, char **start, -- off_t off, int count, -- int *eof, void *data) --{ -- VCHIQ_INSTANCE_T instance = data; -- int len, use_count; -- -- use_count = vchiq_instance_get_use_count(instance); -- len = snprintf(page+off, count, "%d\n", use_count); -- -- return len; --} -- --/* add an instance (process) to the proc entries */ --static int vchiq_proc_add_instance(VCHIQ_INSTANCE_T instance) --{ --#if 1 -- return 0; --#else -- char pidstr[32]; -- struct proc_dir_entry *top, *use_count; -- struct proc_dir_entry *clients = vchiq_clients_top(); -- int pid = instance->pid; -- -- snprintf(pidstr, sizeof(pidstr), "%d", pid); -- top = proc_mkdir(pidstr, clients); -- if (!top) -- goto fail_top; -- -- use_count = create_proc_read_entry("use_count", -- 0444, top, -- proc_read_use_count, -- instance); -- if (!use_count) -- goto fail_use_count; -- -- instance->proc_entry = top; -- -- return 0; -- --fail_use_count: -- remove_proc_entry(top->name, clients); --fail_top: -- return -ENOMEM; --#endif --} -- --static void vchiq_proc_remove_instance(VCHIQ_INSTANCE_T instance) --{ --#if 0 -- struct proc_dir_entry *clients = vchiq_clients_top(); -- remove_proc_entry("use_count", instance->proc_entry); -- remove_proc_entry(instance->proc_entry->name, clients); --#endif --} -- - /**************************************************************************** - * - * vchiq_exit - called when the module is unloaded. -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h -index 75ad4c6..d1e2741 100644 ---- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h -@@ -1,4 +1,5 @@ - /** -+ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved. - * Copyright (c) 2010-2012 Broadcom. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without -@@ -38,6 +39,7 @@ - #include - #include - #include "vchiq_core.h" -+#include "vchiq_debugfs.h" - - - enum vc_suspend_status { -@@ -155,8 +157,7 @@ vchiq_check_resume(VCHIQ_STATE_T *state); - - extern void - vchiq_check_suspend(VCHIQ_STATE_T *state); -- --extern VCHIQ_STATUS_T -+ VCHIQ_STATUS_T - vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle); - - extern VCHIQ_STATUS_T -@@ -192,21 +193,31 @@ vchiq_use_internal(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service, - extern VCHIQ_STATUS_T - vchiq_release_internal(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service); - --void -+extern VCHIQ_DEBUGFS_NODE_T * -+vchiq_instance_get_debugfs_node(VCHIQ_INSTANCE_T instance); -+ -+extern int -+vchiq_instance_get_use_count(VCHIQ_INSTANCE_T instance); -+ -+extern int -+vchiq_instance_get_pid(VCHIQ_INSTANCE_T instance); -+ -+extern int -+vchiq_instance_get_trace(VCHIQ_INSTANCE_T instance); -+ -+extern void -+vchiq_instance_set_trace(VCHIQ_INSTANCE_T instance, int trace); -+ -+extern void - set_suspend_state(VCHIQ_ARM_STATE_T *arm_state, - enum vc_suspend_status new_state); - --void -+extern void - set_resume_state(VCHIQ_ARM_STATE_T *arm_state, - enum vc_resume_status new_state); - --void -+extern void - start_suspend_timer(VCHIQ_ARM_STATE_T *arm_state); - --extern int vchiq_proc_init(void); --extern void vchiq_proc_deinit(void); --extern struct proc_dir_entry *vchiq_proc_top(void); --extern struct proc_dir_entry *vchiq_clients_top(void); -- - - #endif /* VCHIQ_ARM_H */ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c -new file mode 100644 -index 0000000..7e03213 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c -@@ -0,0 +1,383 @@ -+/** -+ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved. -+ * Copyright (c) 2010-2012 Broadcom. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions, and the following disclaimer, -+ * without modification. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. The names of the above-listed copyright holders may not be used -+ * to endorse or promote products derived from this software without -+ * specific prior written permission. -+ * -+ * ALTERNATIVELY, this software may be distributed under the terms of the -+ * GNU General Public License ("GPL") version 2, as published by the Free -+ * Software Foundation. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+ -+#include -+#include "vchiq_core.h" -+#include "vchiq_arm.h" -+#include "vchiq_debugfs.h" -+ -+#ifdef CONFIG_DEBUG_FS -+ -+/**************************************************************************** -+* -+* log category entries -+* -+***************************************************************************/ -+#define DEBUGFS_WRITE_BUF_SIZE 256 -+ -+#define VCHIQ_LOG_ERROR_STR "error" -+#define VCHIQ_LOG_WARNING_STR "warning" -+#define VCHIQ_LOG_INFO_STR "info" -+#define VCHIQ_LOG_TRACE_STR "trace" -+ -+ -+/* Top-level debug info */ -+struct vchiq_debugfs_info { -+ /* Global 'vchiq' debugfs entry used by all instances */ -+ struct dentry *vchiq_cfg_dir; -+ -+ /* one entry per client process */ -+ struct dentry *clients; -+ -+ /* log categories */ -+ struct dentry *log_categories; -+}; -+ -+static struct vchiq_debugfs_info debugfs_info; -+ -+/* Log category debugfs entries */ -+struct vchiq_debugfs_log_entry { -+ const char *name; -+ int *plevel; -+ struct dentry *dir; -+}; -+ -+static struct vchiq_debugfs_log_entry vchiq_debugfs_log_entries[] = { -+ { "core", &vchiq_core_log_level }, -+ { "msg", &vchiq_core_msg_log_level }, -+ { "sync", &vchiq_sync_log_level }, -+ { "susp", &vchiq_susp_log_level }, -+ { "arm", &vchiq_arm_log_level }, -+}; -+static int n_log_entries = -+ sizeof(vchiq_debugfs_log_entries)/sizeof(vchiq_debugfs_log_entries[0]); -+ -+ -+static struct dentry *vchiq_clients_top(void); -+static struct dentry *vchiq_debugfs_top(void); -+ -+static int debugfs_log_show(struct seq_file *f, void *offset) -+{ -+ int *levp = f->private; -+ char *log_value = NULL; -+ -+ switch (*levp) { -+ case VCHIQ_LOG_ERROR: -+ log_value = VCHIQ_LOG_ERROR_STR; -+ break; -+ case VCHIQ_LOG_WARNING: -+ log_value = VCHIQ_LOG_WARNING_STR; -+ break; -+ case VCHIQ_LOG_INFO: -+ log_value = VCHIQ_LOG_INFO_STR; -+ break; -+ case VCHIQ_LOG_TRACE: -+ log_value = VCHIQ_LOG_TRACE_STR; -+ break; -+ default: -+ break; -+ } -+ -+ seq_printf(f, "%s\n", log_value ? log_value : "(null)"); -+ -+ return 0; -+} -+ -+static int debugfs_log_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, debugfs_log_show, inode->i_private); -+} -+ -+static int debugfs_log_write(struct file *file, -+ const char __user *buffer, -+ size_t count, loff_t *ppos) -+{ -+ struct seq_file *f = (struct seq_file *)file->private_data; -+ int *levp = f->private; -+ char kbuf[DEBUGFS_WRITE_BUF_SIZE + 1]; -+ -+ memset(kbuf, 0, DEBUGFS_WRITE_BUF_SIZE + 1); -+ if (count >= DEBUGFS_WRITE_BUF_SIZE) -+ count = DEBUGFS_WRITE_BUF_SIZE; -+ -+ if (copy_from_user(kbuf, buffer, count) != 0) -+ return -EFAULT; -+ kbuf[count - 1] = 0; -+ -+ if (strncmp("error", kbuf, strlen("error")) == 0) -+ *levp = VCHIQ_LOG_ERROR; -+ else if (strncmp("warning", kbuf, strlen("warning")) == 0) -+ *levp = VCHIQ_LOG_WARNING; -+ else if (strncmp("info", kbuf, strlen("info")) == 0) -+ *levp = VCHIQ_LOG_INFO; -+ else if (strncmp("trace", kbuf, strlen("trace")) == 0) -+ *levp = VCHIQ_LOG_TRACE; -+ else -+ *levp = VCHIQ_LOG_DEFAULT; -+ -+ *ppos += count; -+ -+ return count; -+} -+ -+static const struct file_operations debugfs_log_fops = { -+ .owner = THIS_MODULE, -+ .open = debugfs_log_open, -+ .write = debugfs_log_write, -+ .read = seq_read, -+ .llseek = seq_lseek, -+ .release = single_release, -+}; -+ -+/* create an entry under /vchiq/log for each log category */ -+static int vchiq_debugfs_create_log_entries(struct dentry *top) -+{ -+ struct dentry *dir; -+ size_t i; -+ int ret = 0; -+ dir = debugfs_create_dir("log", vchiq_debugfs_top()); -+ if (!dir) -+ return -ENOMEM; -+ debugfs_info.log_categories = dir; -+ -+ for (i = 0; i < n_log_entries; i++) { -+ void *levp = (void *)vchiq_debugfs_log_entries[i].plevel; -+ dir = debugfs_create_file(vchiq_debugfs_log_entries[i].name, -+ 0644, -+ debugfs_info.log_categories, -+ levp, -+ &debugfs_log_fops); -+ if (!dir) { -+ ret = -ENOMEM; -+ break; -+ } -+ -+ vchiq_debugfs_log_entries[i].dir = dir; -+ } -+ return ret; -+} -+ -+static int debugfs_usecount_show(struct seq_file *f, void *offset) -+{ -+ VCHIQ_INSTANCE_T instance = f->private; -+ int use_count; -+ -+ use_count = vchiq_instance_get_use_count(instance); -+ seq_printf(f, "%d\n", use_count); -+ -+ return 0; -+} -+ -+static int debugfs_usecount_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, debugfs_usecount_show, inode->i_private); -+} -+ -+static const struct file_operations debugfs_usecount_fops = { -+ .owner = THIS_MODULE, -+ .open = debugfs_usecount_open, -+ .read = seq_read, -+ .llseek = seq_lseek, -+ .release = single_release, -+}; -+ -+static int debugfs_trace_show(struct seq_file *f, void *offset) -+{ -+ VCHIQ_INSTANCE_T instance = f->private; -+ int trace; -+ -+ trace = vchiq_instance_get_trace(instance); -+ seq_printf(f, "%s\n", trace ? "Y" : "N"); -+ -+ return 0; -+} -+ -+static int debugfs_trace_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, debugfs_trace_show, inode->i_private); -+} -+ -+static int debugfs_trace_write(struct file *file, -+ const char __user *buffer, -+ size_t count, loff_t *ppos) -+{ -+ struct seq_file *f = (struct seq_file *)file->private_data; -+ VCHIQ_INSTANCE_T instance = f->private; -+ char firstchar; -+ -+ if (copy_from_user(&firstchar, buffer, 1) != 0) -+ return -EFAULT; -+ -+ switch (firstchar) { -+ case 'Y': -+ case 'y': -+ case '1': -+ vchiq_instance_set_trace(instance, 1); -+ break; -+ case 'N': -+ case 'n': -+ case '0': -+ vchiq_instance_set_trace(instance, 0); -+ break; -+ default: -+ break; -+ } -+ -+ *ppos += count; -+ -+ return count; -+} -+ -+static const struct file_operations debugfs_trace_fops = { -+ .owner = THIS_MODULE, -+ .open = debugfs_trace_open, -+ .write = debugfs_trace_write, -+ .read = seq_read, -+ .llseek = seq_lseek, -+ .release = single_release, -+}; -+ -+/* add an instance (process) to the debugfs entries */ -+int vchiq_debugfs_add_instance(VCHIQ_INSTANCE_T instance) -+{ -+ char pidstr[16]; -+ struct dentry *top, *use_count, *trace; -+ struct dentry *clients = vchiq_clients_top(); -+ -+ snprintf(pidstr, sizeof(pidstr), "%d", -+ vchiq_instance_get_pid(instance)); -+ -+ top = debugfs_create_dir(pidstr, clients); -+ if (!top) -+ goto fail_top; -+ -+ use_count = debugfs_create_file("use_count", -+ 0444, top, -+ instance, -+ &debugfs_usecount_fops); -+ if (!use_count) -+ goto fail_use_count; -+ -+ trace = debugfs_create_file("trace", -+ 0644, top, -+ instance, -+ &debugfs_trace_fops); -+ if (!trace) -+ goto fail_trace; -+ -+ vchiq_instance_get_debugfs_node(instance)->dentry = top; -+ -+ return 0; -+ -+fail_trace: -+ debugfs_remove(use_count); -+fail_use_count: -+ debugfs_remove(top); -+fail_top: -+ return -ENOMEM; -+} -+ -+void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance) -+{ -+ VCHIQ_DEBUGFS_NODE_T *node = vchiq_instance_get_debugfs_node(instance); -+ debugfs_remove_recursive(node->dentry); -+} -+ -+ -+int vchiq_debugfs_init(void) -+{ -+ BUG_ON(debugfs_info.vchiq_cfg_dir != NULL); -+ -+ debugfs_info.vchiq_cfg_dir = debugfs_create_dir("vchiq", NULL); -+ if (debugfs_info.vchiq_cfg_dir == NULL) -+ goto fail; -+ -+ debugfs_info.clients = debugfs_create_dir("clients", -+ vchiq_debugfs_top()); -+ if (!debugfs_info.clients) -+ goto fail; -+ -+ if (vchiq_debugfs_create_log_entries(vchiq_debugfs_top()) != 0) -+ goto fail; -+ -+ return 0; -+ -+fail: -+ vchiq_debugfs_deinit(); -+ vchiq_log_error(vchiq_arm_log_level, -+ "%s: failed to create debugfs directory", -+ __func__); -+ -+ return -ENOMEM; -+} -+ -+/* remove all the debugfs entries */ -+void vchiq_debugfs_deinit(void) -+{ -+ debugfs_remove_recursive(vchiq_debugfs_top()); -+} -+ -+static struct dentry *vchiq_clients_top(void) -+{ -+ return debugfs_info.clients; -+} -+ -+static struct dentry *vchiq_debugfs_top(void) -+{ -+ BUG_ON(debugfs_info.vchiq_cfg_dir == NULL); -+ return debugfs_info.vchiq_cfg_dir; -+} -+ -+#else /* CONFIG_DEBUG_FS */ -+ -+int vchiq_debugfs_init(void) -+{ -+ return 0; -+} -+ -+void vchiq_debugfs_deinit(void) -+{ -+} -+ -+int vchiq_debugfs_add_instance(VCHIQ_INSTANCE_T instance) -+{ -+ return 0; -+} -+ -+void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance) -+{ -+} -+ -+#endif /* CONFIG_DEBUG_FS */ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h -new file mode 100644 -index 0000000..4d6a378 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h -@@ -0,0 +1,52 @@ -+/** -+ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions, and the following disclaimer, -+ * without modification. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. The names of the above-listed copyright holders may not be used -+ * to endorse or promote products derived from this software without -+ * specific prior written permission. -+ * -+ * ALTERNATIVELY, this software may be distributed under the terms of the -+ * GNU General Public License ("GPL") version 2, as published by the Free -+ * Software Foundation. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#ifndef VCHIQ_DEBUGFS_H -+#define VCHIQ_DEBUGFS_H -+ -+#include "vchiq_core.h" -+ -+typedef struct vchiq_debugfs_node_struct -+{ -+ struct dentry *dentry; -+} VCHIQ_DEBUGFS_NODE_T; -+ -+int vchiq_debugfs_init(void); -+ -+void vchiq_debugfs_deinit(void); -+ -+int vchiq_debugfs_add_instance(VCHIQ_INSTANCE_T instance); -+ -+void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance); -+ -+#endif /* VCHIQ_DEBUGFS_H */ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c -deleted file mode 100644 -index 8e59676..0000000 ---- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c -+++ /dev/null -@@ -1,253 +0,0 @@ --/** -- * Copyright (c) 2010-2012 Broadcom. All rights reserved. -- * -- * Redistribution and use in source and binary forms, with or without -- * modification, are permitted provided that the following conditions -- * are met: -- * 1. Redistributions of source code must retain the above copyright -- * notice, this list of conditions, and the following disclaimer, -- * without modification. -- * 2. Redistributions in binary form must reproduce the above copyright -- * notice, this list of conditions and the following disclaimer in the -- * documentation and/or other materials provided with the distribution. -- * 3. The names of the above-listed copyright holders may not be used -- * to endorse or promote products derived from this software without -- * specific prior written permission. -- * -- * ALTERNATIVELY, this software may be distributed under the terms of the -- * GNU General Public License ("GPL") version 2, as published by the Free -- * Software Foundation. -- * -- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- */ -- -- --#include --#include "vchiq_core.h" --#include "vchiq_arm.h" -- --#if 1 -- --int vchiq_proc_init(void) --{ -- return 0; --} -- --void vchiq_proc_deinit(void) --{ --} -- --#else -- --struct vchiq_proc_info { -- /* Global 'vc' proc entry used by all instances */ -- struct proc_dir_entry *vc_cfg_dir; -- -- /* one entry per client process */ -- struct proc_dir_entry *clients; -- -- /* log categories */ -- struct proc_dir_entry *log_categories; --}; -- --static struct vchiq_proc_info proc_info; -- --struct proc_dir_entry *vchiq_proc_top(void) --{ -- BUG_ON(proc_info.vc_cfg_dir == NULL); -- return proc_info.vc_cfg_dir; --} -- --/**************************************************************************** --* --* log category entries --* --***************************************************************************/ --#define PROC_WRITE_BUF_SIZE 256 -- --#define VCHIQ_LOG_ERROR_STR "error" --#define VCHIQ_LOG_WARNING_STR "warning" --#define VCHIQ_LOG_INFO_STR "info" --#define VCHIQ_LOG_TRACE_STR "trace" -- --static int log_cfg_read(char *buffer, -- char **start, -- off_t off, -- int count, -- int *eof, -- void *data) --{ -- int len = 0; -- char *log_value = NULL; -- -- switch (*((int *)data)) { -- case VCHIQ_LOG_ERROR: -- log_value = VCHIQ_LOG_ERROR_STR; -- break; -- case VCHIQ_LOG_WARNING: -- log_value = VCHIQ_LOG_WARNING_STR; -- break; -- case VCHIQ_LOG_INFO: -- log_value = VCHIQ_LOG_INFO_STR; -- break; -- case VCHIQ_LOG_TRACE: -- log_value = VCHIQ_LOG_TRACE_STR; -- break; -- default: -- break; -- } -- -- len += sprintf(buffer + len, -- "%s\n", -- log_value ? log_value : "(null)"); -- -- return len; --} -- -- --static int log_cfg_write(struct file *file, -- const char __user *buffer, -- unsigned long count, -- void *data) --{ -- int *log_module = data; -- char kbuf[PROC_WRITE_BUF_SIZE + 1]; -- -- (void)file; -- -- memset(kbuf, 0, PROC_WRITE_BUF_SIZE + 1); -- if (count >= PROC_WRITE_BUF_SIZE) -- count = PROC_WRITE_BUF_SIZE; -- -- if (copy_from_user(kbuf, -- buffer, -- count) != 0) -- return -EFAULT; -- kbuf[count - 1] = 0; -- -- if (strncmp("error", kbuf, strlen("error")) == 0) -- *log_module = VCHIQ_LOG_ERROR; -- else if (strncmp("warning", kbuf, strlen("warning")) == 0) -- *log_module = VCHIQ_LOG_WARNING; -- else if (strncmp("info", kbuf, strlen("info")) == 0) -- *log_module = VCHIQ_LOG_INFO; -- else if (strncmp("trace", kbuf, strlen("trace")) == 0) -- *log_module = VCHIQ_LOG_TRACE; -- else -- *log_module = VCHIQ_LOG_DEFAULT; -- -- return count; --} -- --/* Log category proc entries */ --struct vchiq_proc_log_entry { -- const char *name; -- int *plevel; -- struct proc_dir_entry *dir; --}; -- --static struct vchiq_proc_log_entry vchiq_proc_log_entries[] = { -- { "core", &vchiq_core_log_level }, -- { "msg", &vchiq_core_msg_log_level }, -- { "sync", &vchiq_sync_log_level }, -- { "susp", &vchiq_susp_log_level }, -- { "arm", &vchiq_arm_log_level }, --}; --static int n_log_entries = -- sizeof(vchiq_proc_log_entries)/sizeof(vchiq_proc_log_entries[0]); -- --/* create an entry under /proc/vc/log for each log category */ --static int vchiq_proc_create_log_entries(struct proc_dir_entry *top) --{ -- struct proc_dir_entry *dir; -- size_t i; -- int ret = 0; -- dir = proc_mkdir("log", proc_info.vc_cfg_dir); -- if (!dir) -- return -ENOMEM; -- proc_info.log_categories = dir; -- -- for (i = 0; i < n_log_entries; i++) { -- dir = create_proc_entry(vchiq_proc_log_entries[i].name, -- 0644, -- proc_info.log_categories); -- if (!dir) { -- ret = -ENOMEM; -- break; -- } -- -- dir->read_proc = &log_cfg_read; -- dir->write_proc = &log_cfg_write; -- dir->data = (void *)vchiq_proc_log_entries[i].plevel; -- -- vchiq_proc_log_entries[i].dir = dir; -- } -- return ret; --} -- -- --int vchiq_proc_init(void) --{ -- BUG_ON(proc_info.vc_cfg_dir != NULL); -- -- proc_info.vc_cfg_dir = proc_mkdir("vc", NULL); -- if (proc_info.vc_cfg_dir == NULL) -- goto fail; -- -- proc_info.clients = proc_mkdir("clients", -- proc_info.vc_cfg_dir); -- if (!proc_info.clients) -- goto fail; -- -- if (vchiq_proc_create_log_entries(proc_info.vc_cfg_dir) != 0) -- goto fail; -- -- return 0; -- --fail: -- vchiq_proc_deinit(); -- vchiq_log_error(vchiq_arm_log_level, -- "%s: failed to create proc directory", -- __func__); -- -- return -ENOMEM; --} -- --/* remove all the proc entries */ --void vchiq_proc_deinit(void) --{ -- /* log category entries */ -- if (proc_info.log_categories) { -- size_t i; -- for (i = 0; i < n_log_entries; i++) -- if (vchiq_proc_log_entries[i].dir) -- remove_proc_entry( -- vchiq_proc_log_entries[i].name, -- proc_info.log_categories); -- -- remove_proc_entry(proc_info.log_categories->name, -- proc_info.vc_cfg_dir); -- } -- if (proc_info.clients) -- remove_proc_entry(proc_info.clients->name, -- proc_info.vc_cfg_dir); -- if (proc_info.vc_cfg_dir) -- remove_proc_entry(proc_info.vc_cfg_dir->name, NULL); --} -- --struct proc_dir_entry *vchiq_clients_top(void) --{ -- return proc_info.clients; --} -- --#endif - -From 752be8a6ccd72c60151d5ee1bf193d7083b0b1ab Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 12 Oct 2014 14:58:31 +0100 -Subject: [PATCH 80/82] bcm2835-cpufreq: Update to use target_index interface - to fix issues with 3.17 kernel - ---- - drivers/cpufreq/bcm2835-cpufreq.c | 81 ++++++++++++++++----------------------- - 1 file changed, 33 insertions(+), 48 deletions(-) - -diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c -index 7bc55bd..447ca09 100755 ---- a/drivers/cpufreq/bcm2835-cpufreq.c -+++ b/drivers/cpufreq/bcm2835-cpufreq.c -@@ -63,6 +63,12 @@ struct vc_msg { - /* ---------- GLOBALS ---------- */ - static struct cpufreq_driver bcm2835_cpufreq_driver; /* the cpufreq driver global */ - -+static struct cpufreq_frequency_table bcm2835_freq_table[] = { -+ {0, 0, 0}, -+ {0, 0, 0}, -+ {0, 0, CPUFREQ_TABLE_END}, -+}; -+ - /* - =============================================== - clk_rate either gets or sets the clock rates. -@@ -157,78 +163,57 @@ static void __exit bcm2835_cpufreq_module_exit(void) - static int bcm2835_cpufreq_driver_init(struct cpufreq_policy *policy) - { - /* measured value of how long it takes to change frequency */ -- policy->cpuinfo.transition_latency = 355000; /* ns */ -+ const unsigned int transition_latency = 355000; /* ns */ - - /* now find out what the maximum and minimum frequencies are */ -- policy->min = policy->cpuinfo.min_freq = bcm2835_cpufreq_get_clock(VCMSG_GET_MIN_CLOCK); -- policy->max = policy->cpuinfo.max_freq = bcm2835_cpufreq_get_clock(VCMSG_GET_MAX_CLOCK); -- policy->cur = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); -+ bcm2835_freq_table[0].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MIN_CLOCK); -+ bcm2835_freq_table[1].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MAX_CLOCK); - -- print_info("min=%d max=%d cur=%d\n", policy->min, policy->max, policy->cur); -- return 0; -+ print_info("min=%d max=%d\n", bcm2835_freq_table[0].frequency, bcm2835_freq_table[1].frequency); -+ return cpufreq_generic_init(policy, bcm2835_freq_table, transition_latency); - } - - /* -- ================================================================================= -- Target function chooses the most appropriate frequency from the table to enable -- ================================================================================= -+ ===================================================================== -+ Target index function chooses the requested frequency from the table -+ ===================================================================== - */ - --static int bcm2835_cpufreq_driver_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) -+static int bcm2835_cpufreq_driver_target_index(struct cpufreq_policy *policy, unsigned int state) - { -- unsigned int target = target_freq; --#ifdef CPUFREQ_DEBUG_ENABLE -- unsigned int cur = policy->cur; --#endif -- print_debug("%s: min=%d max=%d cur=%d target=%d\n",policy->governor->name,policy->min,policy->max,policy->cur,target_freq); -+ unsigned int target_freq = bcm2835_freq_table[state].frequency; -+ unsigned int cur = bcm2835_cpufreq_set_clock(policy->cur, target_freq); - -- /* if we are above min and using ondemand, then just use max */ -- if (strcmp("ondemand", policy->governor->name)==0 && target > policy->min) -- target = policy->max; -- /* if the frequency is the same, just quit */ -- if (target == policy->cur) -- return 0; -- -- /* otherwise were good to set the clock frequency */ -- policy->cur = bcm2835_cpufreq_set_clock(policy->cur, target); -- -- if (!policy->cur) -+ if (!cur) - { -- print_err("Error occurred setting a new frequency (%d)!\n", target); -- policy->cur = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); -+ print_err("Error occurred setting a new frequency (%d)\n", target_freq); - return -EINVAL; - } -- print_debug("Freq %d->%d (min=%d max=%d target=%d request=%d)\n", cur, policy->cur, policy->min, policy->max, target_freq, target); -+ print_debug("%s: %i: freq %d->%d\n", policy->governor->name, state, policy->cur, cur); - return 0; - } - --static unsigned int bcm2835_cpufreq_driver_get(unsigned int cpu) --{ -- unsigned int actual_rate = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); -- print_debug("cpu=%d\n", actual_rate); -- return actual_rate; --} -- - /* -- ================================================================================= -- Verify ensures that when a policy is changed, it is suitable for the CPU to use -- ================================================================================= -+ ====================================================== -+ Get function returns the current frequency from table -+ ====================================================== - */ - --static int bcm2835_cpufreq_driver_verify(struct cpufreq_policy *policy) -+static unsigned int bcm2835_cpufreq_driver_get(unsigned int cpu) - { -- print_info("switching to governor %s\n", policy->governor->name); -- return 0; -+ unsigned int actual_rate = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); -+ print_debug("%d: freq=%d\n", cpu, actual_rate); -+ return actual_rate <= bcm2835_freq_table[0].frequency ? bcm2835_freq_table[0].frequency : bcm2835_freq_table[1].frequency; - } - -- - /* the CPUFreq driver */ - static struct cpufreq_driver bcm2835_cpufreq_driver = { -- .name = "BCM2835 CPUFreq", -- .init = bcm2835_cpufreq_driver_init, -- .verify = bcm2835_cpufreq_driver_verify, -- .target = bcm2835_cpufreq_driver_target, -- .get = bcm2835_cpufreq_driver_get -+ .name = "BCM2835 CPUFreq", -+ .init = bcm2835_cpufreq_driver_init, -+ .verify = cpufreq_generic_frequency_table_verify, -+ .target_index = bcm2835_cpufreq_driver_target_index, -+ .get = bcm2835_cpufreq_driver_get, -+ .attr = cpufreq_generic_attr, - }; - - MODULE_AUTHOR("Dorian Peake and Dom Cobley"); - -From 411ca756b4567458a9c57ace933a9f025ecd00c7 Mon Sep 17 00:00:00 2001 +From 28bfe06d95a7b2e41f05799c8743716f8db03589 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 81/82] Improve __copy_to_user and __copy_from_user performance +Subject: [PATCH 73/75] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use optimised memcpy/memmove/memcmp/memset implementations. @@ -122777,10 +120559,10 @@ index 3e58d71..0622891 100644 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) -From 58eb5023f30411060f3e905df7b91f3efe9c437c Mon Sep 17 00:00:00 2001 +From 3497a9ec5e0cd3b3da8378c7b0bcb72167211fdc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Oct 2014 11:34:37 +0100 -Subject: [PATCH 82/82] bcm2708: Eliminate i2s debugfs directory error +Subject: [PATCH 74/75] bcm2708: Eliminate i2s debugfs directory error Qualify the two regmap ranges uses by bcm2708-i2s ('-i2s' and '-clk') to avoid the name clash when registering debugfs entries. @@ -122808,3 +120590,26 @@ index 9023984..3fcb740 100644 }, }; + +From 864b0950a0ad41e1036cc2b3875d30f9cf593589 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 20 Oct 2014 14:05:01 +0100 +Subject: [PATCH 75/75] snd-bcm2708: Fix dmesg spam for non-error case + +--- + sound/arm/bcm2835-vchiq.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/arm/bcm2835-vchiq.c b/sound/arm/bcm2835-vchiq.c +index cfa669e..3c95381 100755 +--- a/sound/arm/bcm2835-vchiq.c ++++ b/sound/arm/bcm2835-vchiq.c +@@ -556,7 +556,7 @@ int bcm2835_audio_set_ctls(bcm2835_chip_t * chip) + LOG_ERR("Couldn't set the controls for stream %d\n", i); + ret = -1; + } +- else LOG_ERR(" Controls set for stream %d\n", i); ++ else LOG_DBG(" Controls set for stream %d\n", i); + } + } + LOG_DBG(" .. OUT ret=%d\n", ret);