ssdfb_spi.c (93f31c05) | ssdfb_spi.c (da38dc41) |
---|---|
1/* $NetBSD: ssdfb_spi.c,v 1.12 2022/01/19 05:05:45 thorpej Exp $ */ | 1/* $NetBSD: ssdfb_spi.c,v 1.13 2022/01/19 05:21:44 thorpej Exp $ */ |
2 3/* 4 * Copyright (c) 2019 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Tobias Nygren. 9 * --- 15 unchanged lines hidden (view full) --- 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> | 2 3/* 4 * Copyright (c) 2019 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Tobias Nygren. 9 * --- 15 unchanged lines hidden (view full) --- 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> |
33__KERNEL_RCSID(0, "$NetBSD: ssdfb_spi.c,v 1.12 2022/01/19 05:05:45 thorpej Exp $"); | 33__KERNEL_RCSID(0, "$NetBSD: ssdfb_spi.c,v 1.13 2022/01/19 05:21:44 thorpej Exp $"); |
34 35#include <sys/param.h> 36#include <sys/device.h> 37#include <sys/kernel.h> 38#include <dev/wscons/wsdisplayvar.h> 39#include <dev/rasops/rasops.h> 40#include <dev/spi/spivar.h> 41#include <dev/ic/ssdfbvar.h> --- 83 unchanged lines hidden (view full) --- 125 flags |= (int)dce->value; 126 else 127 flags |= SSDFB_PRODUCT_SSD1322_GENERIC; 128 } 129 130 /* 131 * SSD1306 and SSD1322 data sheets specify 100ns cycle time. 132 */ | 34 35#include <sys/param.h> 36#include <sys/device.h> 37#include <sys/kernel.h> 38#include <dev/wscons/wsdisplayvar.h> 39#include <dev/rasops/rasops.h> 40#include <dev/spi/spivar.h> 41#include <dev/ic/ssdfbvar.h> --- 83 unchanged lines hidden (view full) --- 125 flags |= (int)dce->value; 126 else 127 flags |= SSDFB_PRODUCT_SSD1322_GENERIC; 128 } 129 130 /* 131 * SSD1306 and SSD1322 data sheets specify 100ns cycle time. 132 */ |
133 error = spi_configure(sa->sa_handle, SPI_MODE_0, 10000000); | 133 error = spi_configure(self, sa->sa_handle, SPI_MODE_0, 10000000); |
134 if (error) { | 134 if (error) { |
135 aprint_error(": failed to set Mode 0 @ 10MHz, error=%d\n", 136 error); | |
137 return; 138 } 139 140 /* 141 * Note on interface modes. 142 * 143 * 3 wire mode sends 9 bit sequences over the MOSI, MSB contains 144 * the bit that determines if the lower 8 bits are command or data. --- 409 unchanged lines hidden --- | 135 return; 136 } 137 138 /* 139 * Note on interface modes. 140 * 141 * 3 wire mode sends 9 bit sequences over the MOSI, MSB contains 142 * the bit that determines if the lower 8 bits are command or data. --- 409 unchanged lines hidden --- |