Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
038ef07
Documentation
LICENSES
arch
block
certs
crypto
drivers
accel
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cache
cdrom
cdx
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma-buf
dma
dpll
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband
input
interconnect
iommu
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
altera-stapl
bcm-vk
c2port
cardreader
cb710
cxl
echo
eeprom
Kconfig
Makefile
at24.c
at25.c
digsy_mtc_eeprom.c
ee1004.c
eeprom_93cx6.c
eeprom_93xx46.c
idt_89hpesx.c
max6875.c
genwqe
ibmasm
keba
lis3lv02d
lkdtm
mchp_pci1xxxx
mei
ocxl
pvpanic
sgi-gru
sgi-xp
uacce
vmw_vmci
Kconfig
Makefile
ad525x_dpot-i2c.c
ad525x_dpot-spi.c
ad525x_dpot.c
ad525x_dpot.h
apds9802als.c
apds990x.c
atmel-ssc.c
bh1770glc.c
cs5535-mfgpt.c
ds1682.c
dummy-irq.c
dw-xdata-pcie.c
enclosure.c
fastrpc.c
gehc-achc.c
hi6421v600-irq.c
hisi_hikey_usb.c
hmc6352.c
hpilo.c
hpilo.h
ibmvmc.c
ibmvmc.h
ics932s401.c
isl29003.c
isl29020.c
kgdbts.c
lan966x_pci.c
lan966x_pci.dtso
lattice-ecp3-config.c
misc_minor_kunit.c
mrvl_cn10k_dpi.c
nsm.c
ntsync.c
open-dice.c
pch_phub.c
pci_endpoint_test.c
phantom.c
qcom-coincell.c
rpmb-core.c
smpro-errmon.c
smpro-misc.c
sram-exec.c
sram.c
sram.h
tifm_7xx1.c
tifm_core.c
tps6594-esm.c
tps6594-pfsm.c
tsl2550.c
vcpu_stall_detector.c
vmw_balloon.c
xilinx_sdfec.c
xilinx_tmr_inject.c
xilinx_tmr_manager.c
mmc
most
mtd
mux
net
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci
pcmcia
peci
perf
phy
pinctrl
platform
pmdomain
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
ufs
uio
usb
vdpa
vfio
vhost
video
virt
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile
fs
include
init
io_uring
ipc
kernel
lib
mm
net
rust
samples
scripts
security
sound
tools
usr
virt
.clang-format
.clippy.toml
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
drivers
/
misc
/
eeprom
/
digsy_mtc_eeprom.c
Copy path
Blame
Blame
Latest commit
History
History
97 lines (84 loc) · 2.5 KB
Breadcrumbs
linux
/
drivers
/
misc
/
eeprom
/
digsy_mtc_eeprom.c
Top
File metadata and controls
Code
Blame
97 lines (84 loc) · 2.5 KB
Raw
// SPDX-License-Identifier: GPL-2.0-only /* * EEPROMs access control driver for display configuration EEPROMs * on DigsyMTC board. * * (C) 2011 DENX Software Engineering, Anatolij Gustschin <agust@denx.de> * * FIXME: this driver is used on a device-tree probed platform: it * should be defined as a bit-banged SPI device and probed from the device * tree and not like this with static grabbing of a few numbered GPIO * lines at random. * * Add proper SPI and EEPROM in arch/powerpc/boot/dts/digsy_mtc.dts * and delete this driver. */ #include <linux/gpio/machine.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/spi/spi.h> #include <linux/spi/spi_gpio.h> #define GPIO_EEPROM_CLK 216 #define GPIO_EEPROM_CS 210 #define GPIO_EEPROM_DI 217 #define GPIO_EEPROM_DO 249 #define GPIO_EEPROM_OE 255 #define EE_SPI_BUS_NUM 1 static const struct property_entry digsy_mtc_spi_properties[] = { PROPERTY_ENTRY_U32("data-size", 8), { } }; static const struct software_node digsy_mtc_spi_node = { .properties = digsy_mtc_spi_properties, }; static struct spi_gpio_platform_data eeprom_spi_gpio_data = { .num_chipselect = 1, }; static struct platform_device digsy_mtc_eeprom = { .name = "spi_gpio", .id = EE_SPI_BUS_NUM, .dev = { .platform_data = &eeprom_spi_gpio_data, }, }; static struct gpiod_lookup_table eeprom_spi_gpiod_table = { .dev_id = "spi_gpio.1", .table = { GPIO_LOOKUP("gpio@b00", GPIO_EEPROM_CLK, "sck", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio@b00", GPIO_EEPROM_DI, "mosi", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio@b00", GPIO_EEPROM_DO, "miso", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio@b00", GPIO_EEPROM_CS, "cs", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio@b00", GPIO_EEPROM_OE, "select", GPIO_ACTIVE_LOW), { }, }, }; static struct spi_board_info digsy_mtc_eeprom_info[] __initdata = { { .modalias = "eeprom-93xx46", .max_speed_hz = 1000000, .bus_num = EE_SPI_BUS_NUM, .chip_select = 0, .mode = SPI_MODE_0, }, }; static int __init digsy_mtc_eeprom_devices_init(void) { int ret; gpiod_add_lookup_table(&eeprom_spi_gpiod_table); spi_register_board_info(digsy_mtc_eeprom_info, ARRAY_SIZE(digsy_mtc_eeprom_info)); ret = device_add_software_node(&digsy_mtc_eeprom.dev, &digsy_mtc_spi_node); if (ret) return ret; ret = platform_device_register(&digsy_mtc_eeprom); if (ret) device_remove_software_node(&digsy_mtc_eeprom.dev); return ret; } device_initcall(digsy_mtc_eeprom_devices_init);
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
You can’t perform that action at this time.