2
2
/* Author: Dan Scally <djrscally@gmail.com> */
3
3
4
4
#include <linux/acpi.h>
5
+ #include <acpi/acpi_bus.h>
5
6
#include <linux/cleanup.h>
6
7
#include <linux/device.h>
7
8
#include <linux/i2c.h>
@@ -107,7 +108,6 @@ static const char * const ipu_vcm_types[] = {
107
108
"lc898212axb" ,
108
109
};
109
110
110
- #if IS_ENABLED (CONFIG_ACPI )
111
111
/*
112
112
* Used to figure out IVSC acpi device by ipu_bridge_get_ivsc_acpi_dev()
113
113
* instead of device and driver match to probe IVSC device.
@@ -127,24 +127,18 @@ static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev
127
127
const struct acpi_device_id * acpi_id = & ivsc_acpi_ids [i ];
128
128
struct acpi_device * consumer , * ivsc_adev ;
129
129
130
- acpi_handle handle = acpi_device_handle (adev );
130
+ acpi_handle handle = acpi_device_handle (ACPI_PTR ( adev ) );
131
131
for_each_acpi_dev_match (ivsc_adev , acpi_id -> id , NULL , -1 )
132
132
/* camera sensor depends on IVSC in DSDT if exist */
133
133
for_each_acpi_consumer_dev (ivsc_adev , consumer )
134
- if (consumer -> handle == handle ) {
134
+ if (ACPI_PTR ( consumer -> handle ) == handle ) {
135
135
acpi_dev_put (consumer );
136
136
return ivsc_adev ;
137
137
}
138
138
}
139
139
140
140
return NULL ;
141
141
}
142
- #else
143
- static struct acpi_device * ipu_bridge_get_ivsc_acpi_dev (struct acpi_device * adev )
144
- {
145
- return NULL ;
146
- }
147
- #endif
148
142
149
143
static int ipu_bridge_match_ivsc_dev (struct device * dev , const void * adev )
150
144
{
@@ -259,12 +253,8 @@ static enum v4l2_fwnode_orientation ipu_bridge_parse_orientation(struct acpi_dev
259
253
{
260
254
enum v4l2_fwnode_orientation orientation ;
261
255
struct acpi_pld_info * pld = NULL ;
262
- bool status = false;
263
256
264
- #if IS_ENABLED (CONFIG_ACPI )
265
- status = acpi_get_physical_device_location (adev -> handle , & pld );
266
- #endif
267
- if (!status ) {
257
+ if (!acpi_get_physical_device_location (ACPI_PTR (adev -> handle ), & pld )) {
268
258
dev_warn (ADEV_DEV (adev ), "_PLD call failed, using default orientation\n" );
269
259
return V4L2_FWNODE_ORIENTATION_EXTERNAL ;
270
260
}
@@ -498,9 +488,7 @@ static void ipu_bridge_create_connection_swnodes(struct ipu_bridge *bridge,
498
488
if (sensor -> csi_dev ) {
499
489
const char * device_hid = "" ;
500
490
501
- #if IS_ENABLED (CONFIG_ACPI )
502
491
device_hid = acpi_device_hid (sensor -> ivsc_adev );
503
- #endif
504
492
505
493
snprintf (sensor -> ivsc_name , sizeof (sensor -> ivsc_name ), "%s-%u" ,
506
494
device_hid , sensor -> link );
@@ -671,11 +659,7 @@ static int ipu_bridge_connect_sensor(const struct ipu_sensor_config *cfg,
671
659
struct acpi_device * adev = NULL ;
672
660
int ret ;
673
661
674
- #if IS_ENABLED (CONFIG_ACPI )
675
662
for_each_acpi_dev_match (adev , cfg -> hid , NULL , -1 ) {
676
- #else
677
- while (true) {
678
- #endif
679
663
if (!ACPI_PTR (adev -> status .enabled ))
680
664
continue ;
681
665
@@ -768,15 +752,10 @@ static int ipu_bridge_ivsc_is_ready(void)
768
752
unsigned int i ;
769
753
770
754
for (i = 0 ; i < ARRAY_SIZE (ipu_supported_sensors ); i ++ ) {
771
- #if IS_ENABLED (CONFIG_ACPI )
772
755
const struct ipu_sensor_config * cfg =
773
756
& ipu_supported_sensors [i ];
774
757
775
758
for_each_acpi_dev_match (sensor_adev , cfg -> hid , NULL , -1 ) {
776
- #else
777
- while (true) {
778
- sensor_adev = NULL ;
779
- #endif
780
759
if (!ACPI_PTR (sensor_adev -> status .enabled ))
781
760
continue ;
782
761
0 commit comments