summaryrefslogtreecommitdiff
path: root/backport
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2019-02-21 10:23:08 +0100
committerDominik Sliwa <dominik.sliwa@toradex.com>2019-02-21 10:23:44 +0100
commit0bdb080c70495ea4efbed7661b4fe6100bd5adde (patch)
tree9b0e0278c74c56b724540c9c12621f2fed70a6ff /backport
parente5561ba59729bf97f11bc11bb61fd4ef5c08c3b9 (diff)
Revert "backports: Remove unused parts"
This reverts commit ab3fd3b9a801a9faa2619e2e65207e736f859a6d.
Diffstat (limited to 'backport')
-rw-r--r--backport/Kconfig.sources2
-rw-r--r--backport/Makefile.kernel3
-rw-r--r--backport/backport-include/linux/freezer.h32
-rw-r--r--backport/backport-include/linux/mm.h96
-rw-r--r--backport/backport-include/linux/platform_data/media/si4713.h10
-rw-r--r--backport/backport-include/linux/platform_data/media/soc_camera_platform.h10
-rw-r--r--backport/backport-include/linux/platform_data/media/timb_radio.h10
-rw-r--r--backport/backport-include/linux/platform_data/media/timb_video.h10
-rw-r--r--backport/backport-include/linux/regulator/driver.h33
-rw-r--r--backport/backport-include/sound/core.h20
-rw-r--r--backport/backport-include/sound/pcm.h29
-rw-r--r--backport/compat/Kconfig25
12 files changed, 280 insertions, 0 deletions
diff --git a/backport/Kconfig.sources b/backport/Kconfig.sources
index 5fb44780..11e27df9 100644
--- a/backport/Kconfig.sources
+++ b/backport/Kconfig.sources
@@ -4,7 +4,9 @@ source "$BACKPORT_DIR/compat/Kconfig"
# these are copied from the kernel
source "$BACKPORT_DIR/net/wireless/Kconfig"
source "$BACKPORT_DIR/net/mac80211/Kconfig"
+source "$BACKPORT_DIR/net/bluetooth/Kconfig"
source "$BACKPORT_DIR/drivers/net/wireless/Kconfig"
+source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig"
source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
source "$BACKPORT_DIR/drivers/ssb/Kconfig"
diff --git a/backport/Makefile.kernel b/backport/Makefile.kernel
index 5c966974..8156b1ea 100644
--- a/backport/Makefile.kernel
+++ b/backport/Makefile.kernel
@@ -40,8 +40,11 @@ obj-y += compat/
obj-$(CPTCFG_CFG80211) += net/wireless/
obj-$(CPTCFG_MAC80211) += net/mac80211/
obj-$(CPTCFG_WLAN) += drivers/net/wireless/
+obj-$(CPTCFG_BT) += net/bluetooth/
+obj-$(CPTCFG_BT) += drivers/bluetooth/
obj-$(CPTCFG_SSB) += drivers/ssb/
obj-$(CPTCFG_BCMA) += drivers/bcma/
+obj-$(CPTCFG_ETHERNET) += drivers/net/ethernet/
obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/
obj-$(CPTCFG_USB_WDM) += drivers/usb/class/
diff --git a/backport/backport-include/linux/freezer.h b/backport/backport-include/linux/freezer.h
new file mode 100644
index 00000000..c6053f30
--- /dev/null
+++ b/backport/backport-include/linux/freezer.h
@@ -0,0 +1,32 @@
+#ifndef __BACKPORT_FREEZER_H_INCLUDED
+#define __BACKPORT_FREEZER_H_INCLUDED
+#include_next <linux/freezer.h>
+
+#ifdef CONFIG_FREEZER
+#if LINUX_VERSION_IS_LESS(3,11,0)
+/*
+ * Like schedule_hrtimeout_range(), but should not block the freezer. Do not
+ * call this with locks held.
+ */
+#define freezable_schedule_hrtimeout_range LINUX_BACKPORT(freezable_schedule_hrtimeout_range)
+static inline int freezable_schedule_hrtimeout_range(ktime_t *expires,
+ unsigned long delta, const enum hrtimer_mode mode)
+{
+ int __retval;
+ freezer_do_not_count();
+ __retval = schedule_hrtimeout_range(expires, delta, mode);
+ freezer_count();
+ return __retval;
+}
+#endif /* LINUX_VERSION_IS_LESS(3,11,0) */
+
+#else /* !CONFIG_FREEZER */
+
+#ifndef freezable_schedule_hrtimeout_range
+#define freezable_schedule_hrtimeout_range(expires, delta, mode) \
+ schedule_hrtimeout_range(expires, delta, mode)
+#endif
+
+#endif /* !CONFIG_FREEZER */
+
+#endif /* __BACKPORT_FREEZER_H_INCLUDED */
diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
index b28156d3..587aa8dc 100644
--- a/backport/backport-include/linux/mm.h
+++ b/backport/backport-include/linux/mm.h
@@ -12,6 +12,102 @@
void kvfree(const void *addr);
#endif /* < 3.15 */
+#if LINUX_VERSION_IS_LESS(3,20,0)
+#define get_user_pages_locked LINUX_BACKPORT(get_user_pages_locked)
+long get_user_pages_locked(unsigned long start, unsigned long nr_pages,
+ int write, int force, struct page **pages, int *locked);
+#define get_user_pages_unlocked LINUX_BACKPORT(get_user_pages_unlocked)
+long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
+ int write, int force, struct page **pages);
+#elif LINUX_VERSION_IS_LESS(4,6,0)
+static inline
+long backport_get_user_pages_locked(unsigned long start, unsigned long nr_pages,
+ int write, int force, struct page **pages, int *locked)
+{
+ return get_user_pages_locked(current, current->mm, start, nr_pages,
+ write, force, pages, locked);
+}
+#define get_user_pages_locked LINUX_BACKPORT(get_user_pages_locked)
+
+static inline
+long backport_get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
+ int write, int force, struct page **pages)
+{
+ return get_user_pages_unlocked(current, current->mm, start, nr_pages,
+ write, force, pages);
+}
+#define get_user_pages_unlocked LINUX_BACKPORT(get_user_pages_unlocked)
+#endif
+
+#if LINUX_VERSION_IS_LESS(4,6,0)
+static inline
+long backport_get_user_pages(unsigned long start, unsigned long nr_pages,
+ int write, int force, struct page **pages,
+ struct vm_area_struct **vmas)
+{
+ return get_user_pages(current, current->mm, start, nr_pages,
+ write, force, pages, vmas);
+}
+#define get_user_pages LINUX_BACKPORT(get_user_pages)
+#endif
+
+#ifndef FOLL_TRIED
+#define FOLL_TRIED 0x800 /* a retry, previous pass started an IO */
+#endif
+
+#ifdef CPTCFG_BPAUTO_BUILD_FRAME_VECTOR
+/* Container for pinned pfns / pages */
+struct frame_vector {
+ unsigned int nr_allocated; /* Number of frames we have space for */
+ unsigned int nr_frames; /* Number of frames stored in ptrs array */
+ bool got_ref; /* Did we pin pages by getting page ref? */
+ bool is_pfns; /* Does array contain pages or pfns? */
+ void *ptrs[0]; /* Array of pinned pfns / pages. Use
+ * pfns_vector_pages() or pfns_vector_pfns()
+ * for access */
+};
+
+struct frame_vector *frame_vector_create(unsigned int nr_frames);
+void frame_vector_destroy(struct frame_vector *vec);
+int get_vaddr_frames(unsigned long start, unsigned int nr_pfns,
+ bool write, bool force, struct frame_vector *vec);
+void put_vaddr_frames(struct frame_vector *vec);
+int frame_vector_to_pages(struct frame_vector *vec);
+void frame_vector_to_pfns(struct frame_vector *vec);
+
+static inline unsigned int frame_vector_count(struct frame_vector *vec)
+{
+ return vec->nr_frames;
+}
+
+static inline struct page **frame_vector_pages(struct frame_vector *vec)
+{
+ if (vec->is_pfns) {
+ int err = frame_vector_to_pages(vec);
+
+ if (err)
+ return ERR_PTR(err);
+ }
+ return (struct page **)(vec->ptrs);
+}
+
+static inline unsigned long *frame_vector_pfns(struct frame_vector *vec)
+{
+ if (!vec->is_pfns)
+ frame_vector_to_pfns(vec);
+ return (unsigned long *)(vec->ptrs);
+}
+#endif
+
+#if LINUX_VERSION_IS_LESS(4,1,9) && \
+ LINUX_VERSION_IS_GEQ(3,6,0)
+#define page_is_pfmemalloc LINUX_BACKPORT(page_is_pfmemalloc)
+static inline bool page_is_pfmemalloc(struct page *page)
+{
+ return page->pfmemalloc;
+}
+#endif /* < 4.2 */
+
#if LINUX_VERSION_IS_LESS(4,12,0)
#define kvmalloc LINUX_BACKPORT(kvmalloc)
static inline void *kvmalloc(size_t size, gfp_t flags)
diff --git a/backport/backport-include/linux/platform_data/media/si4713.h b/backport/backport-include/linux/platform_data/media/si4713.h
new file mode 100644
index 00000000..3d49c32f
--- /dev/null
+++ b/backport/backport-include/linux/platform_data/media/si4713.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_SI4713_H
+#define __BACKPORT_SI4713_H
+#include <linux/version.h>
+#if LINUX_VERSION_IS_GEQ(4,5,0)
+#include_next <linux/platform_data/media/si4713.h>
+#else
+#include <media/si4713.h>
+#endif /* < 4.5 */
+
+#endif /* __BACKPORT_SI4713_H */
diff --git a/backport/backport-include/linux/platform_data/media/soc_camera_platform.h b/backport/backport-include/linux/platform_data/media/soc_camera_platform.h
new file mode 100644
index 00000000..927bf8fa
--- /dev/null
+++ b/backport/backport-include/linux/platform_data/media/soc_camera_platform.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_SOC_CAMERA_H__
+#define __BACKPORT_SOC_CAMERA_H__
+#include <linux/version.h>
+#if LINUX_VERSION_IS_GEQ(4,5,0)
+#include_next <linux/platform_data/media/soc_camera_platform.h>
+#else
+#include <media/soc_camera_platform.h>
+#endif /* < 4.5 */
+
+#endif /* __BACKPORT_SOC_CAMERA_H__ */
diff --git a/backport/backport-include/linux/platform_data/media/timb_radio.h b/backport/backport-include/linux/platform_data/media/timb_radio.h
new file mode 100644
index 00000000..f1fb47a2
--- /dev/null
+++ b/backport/backport-include/linux/platform_data/media/timb_radio.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_TIMB_RADIO_
+#define __BACKPORT_TIMB_RADIO_
+#include <linux/version.h>
+#if LINUX_VERSION_IS_GEQ(4,5,0)
+#include_next <linux/platform_data/media/timb_radio.h>
+#else
+#include <media/timb_radio.h>
+#endif /* < 4.5 */
+
+#endif /* __BACKPORT_TIMB_RADIO_ */
diff --git a/backport/backport-include/linux/platform_data/media/timb_video.h b/backport/backport-include/linux/platform_data/media/timb_video.h
new file mode 100644
index 00000000..82ff7887
--- /dev/null
+++ b/backport/backport-include/linux/platform_data/media/timb_video.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_TIMB_VIDEO_
+#define __BACKPORT_TIMB_VIDEO_
+#include <linux/version.h>
+#if LINUX_VERSION_IS_GEQ(4,5,0)
+#include_next <linux/platform_data/media/timb_video.h>
+#else
+#include <media/timb_video.h>
+#endif /* < 4.5 */
+
+#endif /* __BACKPORT_TIMB_VIDEO_ */
diff --git a/backport/backport-include/linux/regulator/driver.h b/backport/backport-include/linux/regulator/driver.h
new file mode 100644
index 00000000..f88d9bef
--- /dev/null
+++ b/backport/backport-include/linux/regulator/driver.h
@@ -0,0 +1,33 @@
+/*
+ * driver.h -- SoC Regulator driver support.
+ *
+ * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
+ *
+ * Author: Liam Girdwood <lrg@slimlogic.co.uk>
+ *
+ * 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.
+ *
+ * Regulator Driver Interface.
+ */
+
+#ifndef __BACKPORT_LINUX_REGULATOR_DRIVER_H_
+#define __BACKPORT_LINUX_REGULATOR_DRIVER_H_
+
+#include <linux/version.h>
+#include_next <linux/regulator/driver.h>
+
+#if LINUX_VERSION_IS_LESS(3,13,0) && \
+ LINUX_VERSION_IS_GEQ(3,5,0)
+#define devm_regulator_register LINUX_BACKPORT(devm_regulator_register)
+struct regulator_dev *
+devm_regulator_register(struct device *dev,
+ const struct regulator_desc *regulator_desc,
+ const struct regulator_config *config);
+#define devm_regulator_unregister LINUX_BACKPORT(devm_regulator_unregister)
+void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev);
+#endif /* LINUX_VERSION_IS_LESS(3,13,0) &&
+ LINUX_VERSION_IS_GEQ(3,5,0) */
+
+#endif /* __BACKPORT_LINUX_REGULATOR_DRIVER_H_ */
diff --git a/backport/backport-include/sound/core.h b/backport/backport-include/sound/core.h
new file mode 100644
index 00000000..79f8b319
--- /dev/null
+++ b/backport/backport-include/sound/core.h
@@ -0,0 +1,20 @@
+#ifndef _BACKPORT_SOUND_CORE_H
+#define _BACKPORT_SOUND_CORE_H
+#include_next <sound/core.h>
+
+#if LINUX_VERSION_IS_LESS(3,15,0)
+#define snd_card_new LINUX_BACKPORT(snd_card_new)
+static inline
+int snd_card_new(struct device *parent, int idx, const char *xid,
+ struct module *module, int extra_size,
+ struct snd_card **card_ret)
+{
+ int ret;
+
+ ret = snd_card_create(idx, xid, module, extra_size, card_ret);
+ snd_card_set_dev(*card_ret, parent);
+ return ret;
+}
+#endif
+
+#endif /* _BACKPORT_SOUND_CORE_H */
diff --git a/backport/backport-include/sound/pcm.h b/backport/backport-include/sound/pcm.h
new file mode 100644
index 00000000..d5794ef9
--- /dev/null
+++ b/backport/backport-include/sound/pcm.h
@@ -0,0 +1,29 @@
+#ifndef __BACKPORT_SOUND_PCM_H
+#define __BACKPORT_SOUND_PCM_H
+#include_next <sound/pcm.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(3,19,0)
+/**
+ * snd_pcm_stop_xrun - stop the running streams as XRUN
+ * @substream: the PCM substream instance
+ *
+ * This stops the given running substream (and all linked substreams) as XRUN.
+ * Unlike snd_pcm_stop(), this function takes the substream lock by itself.
+ *
+ * Return: Zero if successful, or a negative error code.
+ */
+static inline int snd_pcm_stop_xrun(struct snd_pcm_substream *substream)
+{
+ unsigned long flags;
+ int ret = 0;
+
+ snd_pcm_stream_lock_irqsave(substream, flags);
+ if (snd_pcm_running(substream))
+ ret = snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
+ snd_pcm_stream_unlock_irqrestore(substream, flags);
+ return ret;
+}
+#endif /* LINUX_VERSION_IS_LESS(3,19,0) */
+
+#endif /* __BACKPORT_SOUND_PCM_H */
diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index bb5d864c..ee8fc84d 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -131,6 +131,31 @@ config BPAUTO_BUCKET_LOCKS
default y if BPAUTO_RHASHTABLE
#c-file lib/bucket_locks.c
+config BPAUTO_BUILD_HDMI
+ bool
+ # the hdmi driver got some new apis like hdmi_infoframe_unpack() in
+ # kernel 4.0 which are used by some drivers
+ depends on KERNEL_4_0
+ #h-file linux/hdmi.h
+ #c-file drivers/video/hdmi.c
+
+config BPAUTO_HDMI
+ bool
+ select BPAUTO_BUILD_HDMI if KERNEL_4_0
+ # these drivers are using the new features of the hdmi driver.
+ default y if BACKPORTED_VIDEO_ADV7511
+ default y if BACKPORTED_VIDEO_ADV7604
+ default y if BACKPORTED_VIDEO_ADV7842
+
+config BPAUTO_FRAME_VECTOR
+ bool
+
+config BPAUTO_BUILD_FRAME_VECTOR
+ bool
+ default n if FRAME_VECTOR
+ default y if BPAUTO_FRAME_VECTOR
+ #c-file mm/frame_vector.c
+
config BPAUTO_REFCOUNT
bool
default y