aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.4/0215-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch
blob: d27966fc9f70cf31fa63787d843d59dd5cc2b4a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 6ec2115ccc87288132b345ab2cd05aed2d3beb97 Mon Sep 17 00:00:00 2001
From: Nicolas Boullis <nboullis@debian.org>
Date: Wed, 23 Mar 2016 23:40:15 +0100
Subject: [PATCH 215/232] BCM270X_DT: Add DS1339 to i2c-rtc overlay

---
 arch/arm/boot/dts/overlays/README              | 4 ++++
 arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 8 ++++++++
 2 files changed, 12 insertions(+)

--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -371,6 +371,8 @@ Info:   Adds support for a number of I2C
 Load:   dtoverlay=i2c-rtc,<param>=<val>
 Params: ds1307                  Select the DS1307 device
 
+        ds1339                  Select the DS1339 device
+
         ds3231                  Select the DS3231 device
 
         mcp7941x                Select the MCP7941x device
@@ -381,6 +383,8 @@ Params: ds1307                  Select t
 
         pcf8563                 Select the PCF8563 device
 
+        trickle-resistor-ohms   Resistor value for trickle charge (DS1339-only)
+
 
 Name:   i2c0-bcm2708
 Info:   Enable the i2c_bcm2708 driver for the i2c0 bus
--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
+++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
@@ -17,6 +17,12 @@
 				reg = <0x68>;
 				status = "disable";
 			};
+			ds1339: ds1339@68 {
+				compatible = "dallas,ds1339";
+				trickle-resistor-ohms = <0>;
+				reg = <0x68>;
+				status = "disable";
+			};
 			mcp7941x: mcp7941x@6f {
 				compatible = "microchip,mcp7941x";
 				reg = <0x6f>;
@@ -46,10 +52,12 @@
 	};
 	__overrides__ {
 		ds1307 = <&ds1307>,"status";
+		ds1339 = <&ds1339>,"status";
 		ds3231 = <&ds3231>,"status";
 		mcp7941x = <&mcp7941x>,"status";
 		pcf2127 = <&pcf2127>,"status";
 		pcf8523 = <&pcf8523>,"status";
 		pcf8563 = <&pcf8563>,"status";
+		trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0";
 	};
 };
Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
diff -urN shfs-0.35/shfs/Linux-2.6/dir.c shfs-0.35.new/shfs/Linux-2.6/dir.c
--- shfs-0.35/shfs/Linux-2.6/dir.c	2007-01-11 14:59:49.000000000 +0100
+++ shfs-0.35.new/shfs/Linux-2.6/dir.c	2007-01-11 14:55:21.000000000 +0100
@@ -302,8 +302,8 @@
 	
 	shfs_invalid_dir_cache(dir);
 	result = shfs_instantiate(dentry);
-	if (forced_write && dentry->d_inode && dentry->d_inode->u.generic_ip)
-		((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close = 1;
+	if (forced_write && dentry->d_inode && dentry->d_inode->i_private)
+		((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close = 1;
 	return result;
 }
 
diff -urN shfs-0.35/shfs/Linux-2.6/fcache.c shfs-0.35.new/shfs/Linux-2.6/fcache.c
--- shfs-0.35/shfs/Linux-2.6/fcache.c	2004-06-01 15:16:19.000000000 +0200
+++ shfs-0.35.new/shfs/Linux-2.6/fcache.c	2007-01-11 14:55:21.000000000 +0100
@@ -100,7 +100,7 @@
 		VERBOSE("dir in file cache?\n");
 		return -EINVAL;
 	}
-	p = (struct shfs_inode_info *)inode->u.generic_ip;
+	p = (struct shfs_inode_info *)inode->i_private;
 	if (!p) {
 		VERBOSE("inode without info\n");
 		return -EINVAL;
@@ -127,7 +127,7 @@
 		VERBOSE("dir in file cache?\n");
 		return -EINVAL;
 	}
-	p = (struct shfs_inode_info *)inode->u.generic_ip;
+	p = (struct shfs_inode_info *)inode->i_private;
 	if (!p) {
 		VERBOSE("inode without info\n");
 		return -EINVAL;
@@ -160,7 +160,7 @@
 	if (result == 0) {
 		struct shfs_inode_info *p;
 
-		p = (struct shfs_inode_info *)f->f_dentry->d_inode->u.generic_ip;
+		p = (struct shfs_inode_info *)f->f_dentry->d_inode->i_private;
 		if (!p) {
 			VERBOSE("inode without info\n");
 			return -EINVAL;
@@ -184,7 +184,7 @@
 		return -EINVAL;
 	}
 	DEBUG("ino: %lu\n", inode->i_ino);
-	p = (struct shfs_inode_info *)inode->u.generic_ip;
+	p = (struct shfs_inode_info *)inode->i_private;
 	if (!p) {
 		VERBOSE("inode without info\n");
 		return -EINVAL;
@@ -226,7 +226,7 @@
 		VERBOSE("dir in file cache?\n");
 		return -EINVAL;
 	}
-	p = (struct shfs_inode_info *)inode->u.generic_ip;
+	p = (struct shfs_inode_info *)inode->i_private;
 	if (!p) {
 		VERBOSE("inode without info\n");
 		return -EINVAL;
@@ -327,7 +327,7 @@
 		VERBOSE("dir in file cache?\n");
 		return -EINVAL;
 	}
-	p = (struct shfs_inode_info *)inode->u.generic_ip;
+	p = (struct shfs_inode_info *)inode->i_private;
 	if (!p) {
 		VERBOSE("inode without info\n");
 		return -EINVAL;
diff -urN shfs-0.35/shfs/Linux-2.6/file.c shfs-0.35.new/shfs/Linux-2.6/file.c
--- shfs-0.35/shfs/Linux-2.6/file.c	2004-06-01 15:16:19.000000000 +0200
+++ shfs-0.35.new/shfs/Linux-2.6/file.c	2007-01-11 14:55:21.000000000 +0100
@@ -9,6 +9,7 @@
 #include <asm/fcntl.h>
 #include <linux/smp_lock.h>
 #include <linux/stat.h>
+#include <linux/fs.h>
 
 #include "shfs_fs.h"
 #include "shfs_fs_sb.h"
@@ -90,7 +91,7 @@
 	struct dentry *dentry = f->f_dentry;
 	struct shfs_sb_info *info = info_from_dentry(dentry);
 	struct inode *inode = p->mapping->host;
-	struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip;
+	struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private;
 	char *buffer = kmap(p) + offset;
 	int written = 0, result;
 	unsigned count = to - offset;
@@ -242,8 +243,8 @@
 		}
 	}
 	/* if file was forced to be writeable, change attrs back on close */
-	if (dentry->d_inode && dentry->d_inode->u.generic_ip) {
-		if  (((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close) {
+	if (dentry->d_inode && dentry->d_inode->i_private) {
+		if  (((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close) {
 			char name[SHFS_PATH_MAX];
 
 			if (get_name(dentry, name) < 0)
@@ -320,8 +321,8 @@
 
 struct file_operations shfs_file_operations = {
 	.llseek		= generic_file_llseek,
-	.read		= generic_file_read,
-	.write		= generic_file_write,
+	.read		= generic_file_aio_read,
+	.write		= generic_file_aio_write,
 	.ioctl		= shfs_ioctl,
 	.mmap		= generic_file_mmap,
 	.open		= shfs_file_open,
diff -urN shfs-0.35/shfs/Linux-2.6/inode.c shfs-0.35.new/shfs/Linux-2.6/inode.c
--- shfs-0.35/shfs/Linux-2.6/inode.c	2004-06-01 15:16:19.000000000 +0200
+++ shfs-0.35.new/shfs/Linux-2.6/inode.c	2007-01-11 14:55:21.000000000 +0100
@@ -35,7 +35,7 @@
 shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr)
 {
 	struct shfs_sb_info *info = info_from_inode(inode);
-	struct shfs_inode_info *i = inode->u.generic_ip;
+	struct shfs_inode_info *i = inode->i_private;
 	struct timespec last_time = inode->i_mtime;
 	loff_t last_size = inode->i_size;
 
@@ -52,7 +52,6 @@
 	inode->i_ctime	= fattr->f_ctime;
 	inode->i_atime	= fattr->f_atime;
 	inode->i_mtime	= fattr->f_mtime;
-	inode->i_blksize= fattr->f_blksize;
 	inode->i_blocks	= fattr->f_blocks;
 	inode->i_size	= fattr->f_size;
 
@@ -75,7 +74,7 @@
 	if (!inode)
 		return NULL;
 	inode->i_ino = fattr->f_ino;
-	i = inode->u.generic_ip = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL);
+	i = inode->i_private = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL);
 	if (!i)
 		return NULL;
 	i->cache = NULL;
@@ -107,7 +106,7 @@
 	struct shfs_inode_info *i;
 
 	DEBUG("ino: %lu\n", inode->i_ino);
-	i = (struct shfs_inode_info *)inode->u.generic_ip;
+	i = (struct shfs_inode_info *)inode->i_private;
 	if (!i) {
 		VERBOSE("invalid inode\n");
 		goto out;
@@ -172,7 +171,7 @@
 {
 	struct shfs_sb_info *info = info_from_dentry(dentry);
 	struct inode *inode = dentry->d_inode;
-	struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip;
+	struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private;
 	int result;
 
         DEBUG("%s\n", dentry->d_name.name);
@@ -339,9 +338,9 @@
 
 static struct super_block *
 shfs_get_sb(struct file_system_type *fs_type,
-	    int flags, const char *dev_name, void *data)
+	    int flags, const char *dev_name, void *data, struct vfsmount *mnt)
 {
-	return get_sb_nodev(fs_type, flags, data, shfs_read_super);
+	return get_sb_nodev(fs_type, flags, data, shfs_read_super, mnt);
 }
 
 static struct file_system_type sh_fs_type = {
diff -urN shfs-0.35/shfs/Linux-2.6/proc.c shfs-0.35.new/shfs/Linux-2.6/proc.c
--- shfs-0.35/shfs/Linux-2.6/proc.c	2004-06-01 15:16:19.000000000 +0200
+++ shfs-0.35.new/shfs/Linux-2.6/proc.c	2007-01-11 14:55:21.000000000 +0100
@@ -178,7 +178,7 @@
 
 		vec[0].iov_base = (void *)buffer;
 		vec[0].iov_len = c;
-		result = f->f_op->writev(f, (const struct iovec *) &vec, 1, &f->f_pos);
+		result = f->f_op->aio_write(f, (const struct iovec *) &vec, 1, &f->f_pos);
 		if (result < 0) {
 			DEBUG("error: %d\n", result);
 			if (result == -EAGAIN)
@@ -261,7 +261,7 @@
 
 		vec[0].iov_base = buffer;
 		vec[0].iov_len = c;
-		result = f->f_op->readv(f, (const struct iovec *)&vec, 1, &f->f_pos);
+		result = f->f_op->aio_read(f, (const struct iovec *)&vec, 1, &f->f_pos);
 		if (!result) {
 			/*  peer has closed socket */
 			result = -EIO;
@@ -350,7 +350,7 @@
 
 		vec[0].iov_base = BUFFER+LEN;
 		vec[0].iov_len = c;
-		result = f->f_op->readv(f, (const struct iovec *)&vec, 1, &f->f_pos);
+		result = f->f_op->aio_read(f, (const struct iovec *)&vec, 1, &f->f_pos);
 		SIGLOCK(flags);
 		if (result == -EPIPE && !sigpipe) {
 			sigdelset(&current->pending.signal, SIGPIPE);